Skip to content
Snippets Groups Projects

Draft: systemd/systemd: rework bootstrap logic and enable more features

Open Jane Rachinger requested to merge jane400/systemd/rework-apkbuild into master
1 unresolved thread
14 files
+ 318
155
Compare changes
  • Side-by-side
  • Inline
Files
14
From d2592eaecbfd6b85d2f9476e6c03c382079d5e2f Mon Sep 17 00:00:00 2001
From: jane400 <jane400@postmarketos.org>
Date: Wed, 15 Jan 2025 01:24:20 +0100
Subject: [PATCH] curl-util: use curl_getdate instead of implementing http spec
Available since curl 7.1, which is less than the version required in
meson.build
https://curl.se/libcurl/c/curl_getdate.html
---
src/import/curl-util.c | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/src/import/curl-util.c b/src/import/curl-util.c
index 06d20eb557..b51d843f2c 100644
--- a/src/import/curl-util.c
+++ b/src/import/curl-util.c
@@ -387,33 +387,9 @@ int curl_header_strdup(const void *contents, size_t sz, const char *field, char
}
int curl_parse_http_time(const char *t, usec_t *ret) {
- _cleanup_(freelocalep) locale_t loc = (locale_t) 0;
- const char *e;
- struct tm tm;
time_t v;
- assert(t);
- assert(ret);
-
- loc = newlocale(LC_TIME_MASK, "C", (locale_t) 0);
- if (loc == (locale_t) 0)
- return -errno;
-
- /* RFC822 */
- e = strptime_l(t, "%a, %d %b %Y %H:%M:%S %Z", &tm, loc);
- if (!e || *e != 0)
- /* RFC 850 */
- e = strptime_l(t, "%A, %d-%b-%y %H:%M:%S %Z", &tm, loc);
- if (!e || *e != 0)
- /* ANSI C */
- e = strptime_l(t, "%a %b %d %H:%M:%S %Y", &tm, loc);
- if (!e || *e != 0)
- return -EINVAL;
-
- v = timegm(&tm);
- if (v == (time_t) -1)
- return -EINVAL;
-
+ v = curl_getdate(t, NULL);
*ret = (usec_t) v * USEC_PER_SEC;
return 0;
}
--
2.47.1
Loading