bosserver: Catch failures to create daemon thread
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 26 Feb 2013 12:06:15 +0000 (12:06 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 26 Feb 2013 21:58:17 +0000 (13:58 -0800)
If we can't create the bozo daemon thread, then don't keep going
regardless. Just warn the user and exit.

Caught by coverity (#988414)

Change-Id: I46445b1744f7c3c944e917b33a6fc6fb669df002
Reviewed-on: http://gerrit.openafs.org/9269
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/bozo/bosserver.c

index d19e388..baa73cf 100644 (file)
@@ -1103,8 +1103,12 @@ main(int argc, char **argv, char **envp)
        }
     }
 
-    LWP_CreateProcess(BozoDaemon, BOZO_LWP_STACKSIZE, /* priority */ 1,
-                     /* param */ NULL , "bozo-the-clown", &bozo_pid);
+    code = LWP_CreateProcess(BozoDaemon, BOZO_LWP_STACKSIZE, /* priority */ 1,
+                            /* param */ NULL , "bozo-the-clown", &bozo_pid);
+    if (code) {
+       bozo_Log("Failed to create daemon thread\n");
+        exit(1);
+    }
 
     /* try to read the key from the config file */
     tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);