pmaports/maemo/alarmd/alarmd-fix-musl.patch
2020-02-20 14:50:05 +03:00

37 lines
1.3 KiB
Diff

diff --git a/src/sighnd.c b/src/sighnd.c
index 505e79a..cd66ab7 100644
--- a/src/sighnd.c
+++ b/src/sighnd.c
@@ -35,6 +35,16 @@
#include <errno.h>
#include <glib.h>
+/* taken from glibc unistd.h and fixes musl */
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
+
/* ========================================================================= *
* SIGNAL HANDING FUNCTIONALITY
* ========================================================================= */
diff --git a/src/ticker.c b/src/ticker.c
index 7ff6ca9..2f97f47 100644
--- a/src/ticker.c
+++ b/src/ticker.c
@@ -662,10 +662,7 @@ time_t ticker_get_monotonic(void)
static inline int is_leap_year(int y)
{
- // use macro from time.h
- return __isleap(y);
-
- //return (y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0));
+ return (y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0));
}
/* ------------------------------------------------------------------------- *