[PATCH] check if __GLIBC__ is defined before using it

Dmitry V. Levin ldv at altlinux.org
Mon Dec 3 21:33:00 UTC 2012


On Mon, Dec 03, 2012 at 12:29:20AM +0100, John Spencer wrote:
> --- 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_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_MINOR__ == 0
>  typedef struct
>  {
>  	__ptr_t ss_sp;
> diff --git a/util.c b/util.c
> index b058a42..b0cdab7 100644
> --- 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
>  

These two glibc version checks in signal.c remains incomplete after the patch,
I suppose they should be the same as the check in util.c.

When submitting a patch, please follow our simple commit log requirements described in
README-hacking file.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20121204/2a8f2a96/attachment.bin>


More information about the Strace-devel mailing list