fixes for kernelversion

This commit is contained in:
maliakal_d 2021-11-03 14:42:14 +01:00
parent b68ef6cbd0
commit cb39a59508
9 changed files with 11 additions and 9 deletions

View File

@ -66,26 +66,28 @@ int getAbsPath(char *buf, size_t bufSize, char *fname) {
} }
int getTimeFromString(char *buf, time_t *result) { int getTimeFromString(char *buf, time_t *result) {
char buffer[255] = {0};
strcpy(buffer, buf);
// remove timezone as strptime cannot validate timezone despite // remove timezone as strptime cannot validate timezone despite
// documentation (for blackfin) // documentation (for blackfin)
LOG(logDEBUG, ("buf for time %s\n", buf)); LOG(logDEBUG, ("kernel v %s\n", buffer));
const char *timezone = {"CEST"}; const char *timezone = {"CEST"};
char *res = strstr(buf, timezone); char *res = strstr(buffer, timezone);
if (res != NULL) { if (res != NULL) {
size_t cestPos = res - buf; size_t cestPos = res - buffer;
size_t pos = cestPos + strlen(timezone) + 1; size_t pos = cestPos + strlen(timezone) + 1;
while (pos != strlen(buf)) { while (pos != strlen(buffer)) {
buf[cestPos] = buf[pos]; buffer[cestPos] = buffer[pos];
++cestPos; ++cestPos;
++pos; ++pos;
} }
buf[cestPos] = '\0'; buffer[cestPos] = '\0';
} }
LOG(logDEBUG, ("buf after removing CEST %s\n", buf)); LOG(logDEBUG, ("kernel v after removing CEST %s\n", buffer));
// convert to time structure // convert to time structure
struct tm t; struct tm t;
if (NULL == strptime(buf, "%a %b %d %H:%M:%S %Y", &t)) { if (NULL == strptime(buffer, "%a %b %d %H:%M:%S %Y", &t)) {
return FAIL; return FAIL;
} }

View File

@ -6,10 +6,10 @@
#define APILIB 0x211027 #define APILIB 0x211027
#define APIRECEIVER 0x211020 #define APIRECEIVER 0x211020
#define APIGUI 0x211021 #define APIGUI 0x211021
#define APIEIGER 0x211027
#define APICTB 0x211103 #define APICTB 0x211103
#define APIGOTTHARD 0x211103 #define APIGOTTHARD 0x211103
#define APIGOTTHARD2 0x211103 #define APIGOTTHARD2 0x211103
#define APIJUNGFRAU 0x211103 #define APIJUNGFRAU 0x211103
#define APIMYTHEN3 0x211103 #define APIMYTHEN3 0x211103
#define APIMOENCH 0x211103 #define APIMOENCH 0x211103
#define APIEIGER 0x211103