Deleted Added
full compact
signal.c (252429) signal.c (287292)
1/*
2 * Copyright (c) 1985, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)signal.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1985, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)signal.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/lib/libc/gen/signal.c 252429 2013-06-30 20:51:15Z jilles $");
34__FBSDID("$FreeBSD: head/lib/libc/gen/signal.c 287292 2015-08-29 14:25:01Z kib $");
35
36/*
37 * Almost backwards compatible signal.
38 */
39#include "namespace.h"
40#include <signal.h>
41#include "un-namespace.h"
42#include "libc_private.h"
43
44sigset_t _sigintr __hidden; /* shared with siginterrupt */
45
46sig_t
35
36/*
37 * Almost backwards compatible signal.
38 */
39#include "namespace.h"
40#include <signal.h>
41#include "un-namespace.h"
42#include "libc_private.h"
43
44sigset_t _sigintr __hidden; /* shared with siginterrupt */
45
46sig_t
47signal(s, a)
48 int s;
49 sig_t a;
47signal(int s, sig_t a)
50{
51 struct sigaction sa, osa;
52
53 sa.sa_handler = a;
54 sigemptyset(&sa.sa_mask);
55 sa.sa_flags = 0;
56 if (!sigismember(&_sigintr, s))
57 sa.sa_flags |= SA_RESTART;
48{
49 struct sigaction sa, osa;
50
51 sa.sa_handler = a;
52 sigemptyset(&sa.sa_mask);
53 sa.sa_flags = 0;
54 if (!sigismember(&_sigintr, s))
55 sa.sa_flags |= SA_RESTART;
58 if (_sigaction(s, &sa, &osa) < 0)
56 if (__libc_sigaction(s, &sa, &osa) < 0)
59 return (SIG_ERR);
60 return (osa.sa_handler);
61}
57 return (SIG_ERR);
58 return (osa.sa_handler);
59}