]> granicus.if.org Git - strace/commitdiff
Fix glibc version checks
authorJohn Spencer <maillist-strace@barfooze.de>
Sun, 2 Dec 2012 23:27:22 +0000 (00:27 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 6 Dec 2012 02:20:33 +0000 (02:20 +0000)
* util.c: Check if __GLIBC__ is defined before using it.
* signal.c: Likewise.  Fix __GLIBC_MINOR__ checks.

signal.c
util.c

index efe335c291a6247c59c45589ca5897e757a3cecf..c77758f7782e1680b6a95f6caf393af88a4cf96a 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -419,7 +419,7 @@ print_sigset(struct tcb *tcp, long addr, int rt)
 # define SI_FROMUSER(sip)      ((sip)->si_code <= 0)
 #endif
 
-#if __GLIBC_MINOR__ < 1
+#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
 /* Type for data associated with a signal.  */
 typedef union sigval
 {
@@ -1111,7 +1111,7 @@ sys_sigsuspend(struct tcb *tcp)
 #if !defined SS_ONSTACK
 #define SS_ONSTACK      1
 #define SS_DISABLE      2
-#if __GLIBC_MINOR__ == 0
+#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
 typedef struct
 {
        __ptr_t ss_sp;
diff --git a/util.c b/util.c
index a4393887308c24ac4ca637fe6615a4f04f337591..f42024d82f0540ad043ba48f033a956e5fe53527 100644 (file)
--- a/util.c
+++ b/util.c
@@ -39,7 +39,7 @@
 # include <sys/uio.h>
 #endif
 
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
+#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
 # include <linux/ptrace.h>
 #endif