From 2248def17a7a9d5229a147d29d96f655a056bf13 Mon Sep 17 00:00:00 2001 From: jb Date: Fri, 20 Feb 1998 07:28:50 +0000 Subject: Remove the casts on signal() returns and compare the returned value with SIG_ERR to detect the error case. Suggested by: bde. --- sbin/slattach/slattach.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index 76d5b55..cdc0c01 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -42,7 +42,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)slattach.c 4.6 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$Id: slattach.c,v 1.29 1997/12/21 13:42:27 eivind Exp $"; +static char rcsid[] = "$Id: slattach.c,v 1.30 1998/01/25 09:16:55 jb Exp $"; #endif /* not lint */ #include @@ -208,13 +208,13 @@ main(int argc, char **argv) slip_discipline(); /* switch to slip line discipline */ /* upon INT log a timestamp and exit. */ - if ((long)signal(SIGINT,sigint_handler) < 0) + if (signal(SIGINT,sigint_handler) == SIG_ERR) syslog(LOG_NOTICE,"cannot install SIGINT handler: %m"); /* upon TERM log a timestamp and exit. */ - if ((long)signal(SIGTERM,sigterm_handler) < 0) + if (signal(SIGTERM,sigterm_handler) == SIG_ERR) syslog(LOG_NOTICE,"cannot install SIGTERM handler: %m"); /* upon HUP redial and reconnect. */ - if ((long)signal(SIGHUP,sighup_handler) < 0) + if (signal(SIGHUP,sighup_handler) == SIG_ERR) syslog(LOG_NOTICE,"cannot install SIGHUP handler: %m"); if (redial_on_startup) @@ -272,7 +272,7 @@ void acquire_line() fclose(pidfile); } - if ((long)signal(SIGHUP,sighup_handler) < 0) /* Re-enable HUP signal */ + if (signal(SIGHUP,sighup_handler) == SIG_ERR) /* Re-enable HUP signal */ syslog(LOG_NOTICE,"cannot install SIGHUP handler: %m"); if (uucp_lock) { -- cgit v1.1