diff options
author | Elliott Hughes <enh@google.com> | 2013-06-05 18:14:30 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-06-05 18:14:30 -0700 |
commit | b166e699dcf34ef70a999e7fc0990e75383acef7 (patch) | |
tree | 9312b32bf87f4a28aa987b6de87185bf7102fae2 | |
parent | e51cd6f9c9c4aaf857943f91c55458ce622592cf (diff) | |
parent | e84cfbefd82f552490c580d35a54db4f53b6e5fb (diff) | |
download | android_bionic-b166e699dcf34ef70a999e7fc0990e75383acef7.tar.gz android_bionic-b166e699dcf34ef70a999e7fc0990e75383acef7.tar.bz2 android_bionic-b166e699dcf34ef70a999e7fc0990e75383acef7.zip |
am e84cfbef: am b7b4f5b8: Merge "update signal.h to be C90 compatable"
* commit 'e84cfbefd82f552490c580d35a54db4f53b6e5fb':
update signal.h to be C90 compatable
-rw-r--r-- | libc/include/signal.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/include/signal.h b/libc/include/signal.h index 8c9b170b9..15d2d3a68 100644 --- a/libc/include/signal.h +++ b/libc/include/signal.h @@ -59,32 +59,32 @@ extern const char* const sys_signame[]; static __inline__ int sigismember(const sigset_t* set, int signum) { int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0. + const unsigned long* local_set = (const unsigned long*) set; if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) { errno = EINVAL; return -1; } - const unsigned long* local_set = (const unsigned long*) set; return (int) ((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1); } static __inline__ int sigaddset(sigset_t* set, int signum) { int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0. + unsigned long* local_set = (unsigned long*) set; if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) { errno = EINVAL; return -1; } - unsigned long* local_set = (unsigned long*) set; local_set[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT); return 0; } static __inline__ int sigdelset(sigset_t* set, int signum) { int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0. + unsigned long* local_set = (unsigned long*) set; if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) { errno = EINVAL; return -1; } - unsigned long* local_set = (unsigned long*) set; local_set[bit / LONG_BIT] &= ~(1UL << (bit % LONG_BIT)); return 0; } |