[PATCH 3/3] platform: fix missing sigisemptyset

Daniel Borca dborca at yahoo.com
Tue Nov 26 20:01:36 UTC 2013


sigisemptyset() is a glibc function
-- 
-dborca
-------------- next part --------------
Signed-off-by: Daniel Borca <dborca at yahoo.com>
---
 include/platform.h |    6 ++++++
 libbb/platform.c   |   12 ++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/include/platform.h b/include/platform.h
index 18b09e5..89ac50c 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -367,6 +367,7 @@ typedef unsigned smalluint;
 #define HAVE_PTSNAME_R 1
 #define HAVE_SETBIT 1
 #define HAVE_SIGHANDLER_T 1
+#define HAVE_SIGISEMPTYSET 1
 #define HAVE_STPCPY 1
 #define HAVE_STRCASESTR 1
 #define HAVE_STRCHRNUL 1
@@ -437,6 +438,7 @@ typedef unsigned smalluint;
 
 #if defined(__FreeBSD__) || defined(__APPLE__)
 # undef HAVE_MEMPCPY
+# undef HAVE_SIGISEMPTYSET
 # undef HAVE_STRCHRNUL
 #endif
 
@@ -491,6 +493,10 @@ extern char *mkdtemp(char *template) FAST_FUNC;
 typedef void (*sighandler_t)(int);
 #endif
 
+#ifndef HAVE_SIGISEMPTYSET
+extern int sigisemptyset(sigset_t *set);
+#endif
+
 #ifndef HAVE_STPCPY
 extern char *stpcpy(char *p, const char *to_add) FAST_FUNC;
 #endif
diff --git a/libbb/platform.c b/libbb/platform.c
index 1973451..e237404 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -176,3 +176,15 @@ ssize_t FAST_FUNC getline(char **lineptr, size_t *n, FILE *stream)
 	return len;
 }
 #endif
+
+#ifndef HAVE_SIGISEMPTYSET
+int sigisemptyset(sigset_t *set)
+{
+	sigset_t empty;
+	int ret = sigemptyset(&empty);
+	if (ret == 0) {
+		ret = !memcmp(&empty, set, sizeof(sigset_t));
+	}
+	return ret;
+}
+#endif
-- 
1.7.4.4



More information about the busybox mailing list