mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
fixes for kernelversion
This commit is contained in:
parent
b68ef6cbd0
commit
cb39a59508
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -66,26 +66,28 @@ int getAbsPath(char *buf, size_t bufSize, char *fname) {
|
||||
}
|
||||
|
||||
int getTimeFromString(char *buf, time_t *result) {
|
||||
char buffer[255] = {0};
|
||||
strcpy(buffer, buf);
|
||||
// remove timezone as strptime cannot validate timezone despite
|
||||
// documentation (for blackfin)
|
||||
LOG(logDEBUG, ("buf for time %s\n", buf));
|
||||
LOG(logDEBUG, ("kernel v %s\n", buffer));
|
||||
const char *timezone = {"CEST"};
|
||||
char *res = strstr(buf, timezone);
|
||||
char *res = strstr(buffer, timezone);
|
||||
if (res != NULL) {
|
||||
size_t cestPos = res - buf;
|
||||
size_t cestPos = res - buffer;
|
||||
size_t pos = cestPos + strlen(timezone) + 1;
|
||||
while (pos != strlen(buf)) {
|
||||
buf[cestPos] = buf[pos];
|
||||
while (pos != strlen(buffer)) {
|
||||
buffer[cestPos] = buffer[pos];
|
||||
++cestPos;
|
||||
++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
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
#define APILIB 0x211027
|
||||
#define APIRECEIVER 0x211020
|
||||
#define APIGUI 0x211021
|
||||
#define APIEIGER 0x211027
|
||||
#define APICTB 0x211103
|
||||
#define APIGOTTHARD 0x211103
|
||||
#define APIGOTTHARD2 0x211103
|
||||
#define APIJUNGFRAU 0x211103
|
||||
#define APIMYTHEN3 0x211103
|
||||
#define APIMOENCH 0x211103
|
||||
#define APIEIGER 0x211103
|
||||
|
Loading…
x
Reference in New Issue
Block a user