test for failed forker creation before touching struct members
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 29 Jun 2007 14:07:01 +0000 (14:07 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 29 Jun 2007 14:07:01 +0000 (14:07 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@985 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_prefork.c

index 01a97cc..36b203c 100644 (file)
@@ -69,14 +69,14 @@ int osrf_prefork_run(char* appname) {
        prefork_simple* forker = prefork_simple_init(
                osrfSystemGetTransportClient(), maxr, minc, maxc);
 
-       forker->appname = strdup(appname);
-       forker->keepalive       = kalive;
-
        if(forker == NULL) {
                osrfLogError( OSRF_LOG_MARK, "osrf_prefork_run() failed to create prefork_simple object");
                return -1;
        }
 
+       forker->appname = strdup(appname);
+       forker->keepalive       = kalive;
+
        prefork_launch_children(forker);
 
        osrf_prefork_register_routers(appname);