From: Simon Wilkinson Date: Fri, 22 Feb 2013 10:35:48 +0000 (+0000) Subject: gtx: Return failure if gtx_Init can't start thread X-Git-Tag: openafs-stable-1_8_0pre1~1444 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f238d0d09e7cf6f28a47368bb026b45bd57be8d1 gtx: Return failure if gtx_Init can't start thread If LWP_CreateProcess fails in gtx_Init return NULL, rather than silently swallowing the failure. Caught by clang-analyzer Change-Id: I5db5667f9dae3f405e88cf9c57e6b8a069ea28a3 Reviewed-on: http://gerrit.openafs.org/9236 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman --- diff --git a/src/gtx/input.c b/src/gtx/input.c index 932ce85..f7303f6 100644 --- a/src/gtx/input.c +++ b/src/gtx/input.c @@ -92,10 +92,13 @@ gtx_Init(int astartInput, /* if we start input thread */ IOMGR_Initialize(); /* input thread uses it */ - if (astartInput) - code = - LWP_CreateProcess(gtx_InputServer, 8192, LWP_NORMAL_PRIORITY, - (void *)0, "gx-listener", &junk); + if (astartInput) { + code = LWP_CreateProcess(gtx_InputServer, 8192, LWP_NORMAL_PRIORITY, + NULL, "gx-listener", &junk); + if (code) + return NULL; + } + /* all done */ twin = &gator_basegwin; return twin;