Date: Thu, 10 Feb 2011 17:19:38 GMT From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 188689 for review Message-ID: <201102101719.p1AHJc9q002355@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@188689?ac=10 Change 188689 by trasz@trasz_victim on 2011/02/10 17:19:24 Replace signal(3) with sigaction(3). Affected files ... .. //depot/projects/soc2009/trasz_limits/lib/libutil/login_class.c#8 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/lib/libutil/login_class.c#8 (text+ko) ==== @@ -40,6 +40,7 @@ #include <login_cap.h> #include <paths.h> #include <pwd.h> +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -425,7 +426,7 @@ quad_t p; mode_t mymask; login_cap_t *llc = NULL; - sig_t prevsig; + struct sigaction sa, prevsa; struct rtprio rtp; int error; @@ -519,9 +520,12 @@ * XXX: This is a workaround to fail gracefully in case the kernel * does not support setloginclass(2). */ - prevsig = signal(SIGSYS, SIG_IGN); + bzero(&sa, sizeof(sa)); + sa.sa_handler = SIG_IGN; + sigfillset(&sa.sa_mask); + sigaction(SIGSYS, &sa, &prevsa); error = setloginclass(lc->lc_class); - signal(SIGSYS, prevsig); + sigaction(SIGSYS, &prevsa, NULL); if (error != 0) { syslog(LOG_ERR, "setloginclass(%s): %m", lc->lc_class); #ifdef notyet
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102101719.p1AHJc9q002355>
