diff options
Diffstat (limited to 'community/gvmd/strptime.patch')
-rw-r--r-- | community/gvmd/strptime.patch | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/community/gvmd/strptime.patch b/community/gvmd/strptime.patch deleted file mode 100644 index 91ea06b1684..00000000000 --- a/community/gvmd/strptime.patch +++ /dev/null @@ -1,113 +0,0 @@ -diff --git a/src/manage.c b/src/manage.c -index f0e79b435..e473d4807 100644 ---- a/src/manage.c -+++ b/src/manage.c -@@ -5782,7 +5782,11 @@ manage_scap_update_time () - if (strptime (content, "%Y%m%d%H%M", &update_time)) - { - static char time_string[100]; -- strftime (time_string, 99, "%FT%T.000%z", &update_time); -+ #if !defined(__GLIBC__) -+ strftime (time_string, 99, "%Y-%m-%dT%T.000", &update_time); -+ #else -+ strftime (time_string, 99, "%FT%T.000%z", &update_time); -+ #endif - return time_string; - } - return ""; -diff --git a/src/manage_sql.c b/src/manage_sql.c -index 1d107a70f..fbf4ceacf 100644 ---- a/src/manage_sql.c -+++ b/src/manage_sql.c -@@ -26273,7 +26273,11 @@ host_summary_append (GString *host_summary_buffer, const char *host, - struct tm start_tm; - - memset (&start_tm, 0, sizeof (struct tm)); -- if (strptime (start_iso, "%FT%H:%M:%S", &start_tm) == NULL) -+ #if !defined(__GLIBC__) -+ if (strptime (start_iso, "%Y-%m-%dT%H:%M:%S", &start_tm) == NULL) -+ #else -+ if (strptime (start_iso, "%FT%H:%M:%S", &start_tm) == NULL) -+ #endif - { - g_warning ("%s: Failed to parse start", __func__); - return; -@@ -26293,7 +26297,11 @@ host_summary_append (GString *host_summary_buffer, const char *host, - struct tm end_tm; - - memset (&end_tm, 0, sizeof (struct tm)); -- if (strptime (end_iso, "%FT%H:%M:%S", &end_tm) == NULL) -+ #if !defined(__GLIBC__) -+ if (strptime (end_iso, "%Y-%m-%dT%H:%M:%S", &end_tm) == NULL) -+ #else -+ if (strptime (end_iso, "%FT%H:%M:%S", &end_tm) == NULL) -+ #endif - { - g_warning ("%s: Failed to parse end", __func__); - return; -diff --git a/src/utils.c b/src/utils.c -index d44f5bd6f..c2403a0d6 100644 ---- a/src/utils.c -+++ b/src/utils.c -@@ -366,20 +366,31 @@ parse_iso_time_tz (const char *text_time, const char *fallback_tz) - secs_str && strcmp (secs_str, "") - ? secs_str : ":00", - offset_str ? offset_str : ""); -- -- if (strptime_with_reset ((char*) cleaned_text_time, "%FT%T%z", &tm)) -+ #if !defined(__GLIBC__) -+ if (strptime_with_reset ((char*) cleaned_text_time, "%Y-%m-%dT%T", &tm)) -+ #else -+ if (strptime_with_reset ((char*) cleaned_text_time, "%FT%T%z", &tm)) -+ #endif - { - /* ISO time with numeric offset (e.g. 2020-06-01T01:02:03+04:30) */ - tm.tm_sec = tm.tm_sec - tm.tm_gmtoff; - tm.tm_gmtoff = 0; - epoch_time = mktime_with_tz (&tm, "UTC"); - } -- else if (strptime_with_reset ((char*) cleaned_text_time, "%FT%TZ", &tm)) -+ #if !defined(__GLIBC__) -+ else if (strptime_with_reset ((char*) cleaned_text_time, "%Y-%m-%dT%T", &tm)) -+ #else -+ else if (strptime_with_reset ((char*) cleaned_text_time, "%FT%TZ", &tm)) -+ #endif - { - /* ISO time with "Z" for UTC timezone (e.g. 2020-06-01T01:02:03Z) */ - epoch_time = mktime_with_tz (&tm, "UTC"); - } -- else if (strptime_with_reset ((char*) cleaned_text_time, "%FT%T", &tm)) -+ #if !defined(__GLIBC__) -+ else if (strptime_with_reset ((char*) cleaned_text_time, "%Y-%m-%dT%T", &tm)) -+ #else -+ else if (strptime_with_reset ((char*) cleaned_text_time, "%FT%T", &tm)) -+ #endif - { - /* ISO time without timezone suffix (e.g. 2020-06-01T01:02:03) */ - epoch_time = mktime_with_tz (&tm, fallback_tz ? fallback_tz : "UTC"); -@@ -429,7 +440,11 @@ iso_time_internal (time_t *epoch_time, const char **abbrev) - if (timezone == 0) - #endif - { -- if (strftime (time_string, 98, "%FT%TZ", &tm) == 0) -+ #if !defined(__GLIBC__) -+ if (strftime (time_string, 98, "%Y-%m-%dT%T", &tm) == 0) -+ #else -+ if (strftime (time_string, 98, "%FT%TZ", &tm) == 0) -+ #endif - return NULL; - - if (abbrev) -@@ -439,7 +454,11 @@ iso_time_internal (time_t *epoch_time, const char **abbrev) - { - int len; - -- if (strftime (time_string, 98, "%FT%T%z", &tm) == 0) -+ #if !defined(__GLIBC__) -+ if (strftime (time_string, 98, "%Y-%m-%dT%T", &tm) == 0) -+ #else -+ if (strftime (time_string, 98, "%FT%T%z", &tm) == 0) -+ #endif - return NULL; - - /* Insert the ISO 8601 colon by hand. */ |