summaryrefslogtreecommitdiff
path: root/libc/signal/sigset-cvt-mask.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/signal/sigset-cvt-mask.h')
-rw-r--r--libc/signal/sigset-cvt-mask.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/libc/signal/sigset-cvt-mask.h b/libc/signal/sigset-cvt-mask.h
index 7b2f4cdce..c497ebfff 100644
--- a/libc/signal/sigset-cvt-mask.h
+++ b/libc/signal/sigset-cvt-mask.h
@@ -15,26 +15,22 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
-static __inline__ int __attribute__ ((unused))
-sigset_set_old_mask (sigset_t *set, int mask)
-{
- unsigned long int *ptr;
- int cnt;
-
- ptr = &set->__val[0];
+#ifndef _SIGSET_CVT_MASK_H
+#define _SIGSET_CVT_MASK_H
- *ptr++ = (unsigned int) mask;
+#include <string.h>
- cnt = _SIGSET_NWORDS - 2;
- do
- *ptr++ = 0ul;
- while (--cnt >= 0);
-
- return 0;
+static __inline__ void __attribute__ ((unused))
+sigset_set_old_mask (sigset_t *set, int mask)
+{
+ if (_SIGSET_NWORDS == 2) /* typical */
+ set->__val[1] = 0;
+ if (_SIGSET_NWORDS > 2)
+ memset(set, 0, sizeof(*set));
+ set->__val[0] = (unsigned int) mask;
}
static __inline__ int __attribute__ ((unused))
@@ -42,3 +38,5 @@ sigset_get_old_mask (const sigset_t *set)
{
return (unsigned int) set->__val[0];
}
+
+#endif