svn commit: r278690 - head/usr.sbin/gssd
Mark Johnston
markj at FreeBSD.org
Fri Feb 13 18:32:56 UTC 2015
Author: markj
Date: Fri Feb 13 18:32:55 2015
New Revision: 278690
URL: https://svnweb.freebsd.org/changeset/base/278690
Log:
Check for an error from daemon(3), and correct the check for an error from
socket(2).
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Modified:
head/usr.sbin/gssd/gssd.c
Modified: head/usr.sbin/gssd/gssd.c
==============================================================================
--- head/usr.sbin/gssd/gssd.c Fri Feb 13 18:16:08 2015 (r278689)
+++ head/usr.sbin/gssd/gssd.c Fri Feb 13 18:32:55 2015 (r278690)
@@ -193,7 +193,8 @@ main(int argc, char **argv)
gssd_load_mech();
if (!debug_level) {
- daemon(0, 0);
+ if (daemon(0, 0) != 0)
+ err(1, "Can't daemonize");
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
signal(SIGHUP, SIG_IGN);
@@ -206,7 +207,7 @@ main(int argc, char **argv)
strcpy(sun.sun_path, _PATH_GSSDSOCK);
sun.sun_len = SUN_LEN(&sun);
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
- if (!fd) {
+ if (fd < 0) {
if (debug_level == 0) {
syslog(LOG_ERR, "Can't create local gssd socket");
exit(1);
More information about the svn-src-head
mailing list