1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-19 09:15:30 +03:00
aports/testing/snapper/musl-mktime.patch
Stefan R 7f90328d3f testing/snapper: config and musl fixes
Add dbus as dependency.
Readd dbus config files in remove-systemd.patch.
Fix conjob paths in scripts/Makefile.am.
Install data/sysconfig.snapper to /etc/conf.d/snapper.
Disable ext4 support, because it is experimental and not support with standard kernel and tools.
Fix regex (because the '?' operator isn't supported).
Fix strptime in snapper/AppUtil.cc, because musl doesn't support '%F'.
2019-03-05 15:56:54 +00:00

19 lines
597 B
Diff

According to http://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_chapter/libc_21.html
timelocal(2) is functionally identical to mktime(2), but more
mnemonically named. There is no timelocal(2) defined in musl libc.
--- a/snapper/AppUtil.cc
+++ b/snapper/AppUtil.cc
@@ -279,10 +279,10 @@
{
struct tm s;
memset(&s, 0, sizeof(s));
- const char* p = strptime(str.c_str(), "%F %T", &s);
+ const char* p = strptime(str.c_str(), "%Y-%m-%d %T", &s);
if (!p || *p != '\0')
return (time_t)(-1);
- return utc ? timegm(&s) : timelocal(&s);
+ return utc ? timegm(&s) : mktime(&s);
}