Show
Ignore:
Timestamp:
07/14/2008 03:45:05 PM (8 weeks ago)
Author:
glen
Message:

- let spawn-fcgi propagate exit code from spawned fcgi application

Location:
branches/lighttpd-1.4.x
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r2192 r2198  
    2727  * Implement a clean way to open /dev/null and use it to close stdin/out/err in the needed places (#624) 
    2828  * merge spawn-fcgi changes from trunk (from @2191) 
     29  * let spawn-fcgi propagate exit code from spawned fcgi application 
    2930 
    3031- 1.4.19 - 2008-03-10 
  • branches/lighttpd-1.4.x/src/spawn-fcgi.c

    r2196 r2198  
    4040int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) { 
    4141        int fcgi_fd; 
    42         int socket_type, status; 
     42        int socket_type, status, rc = 0; 
    4343        struct timeval tv = { 0, 100 * 1000 }; 
    4444 
     
    228228                                                fprintf(stderr, "%s.%d: child exited with: %d\n", 
    229229                                                        __FILE__, __LINE__, WEXITSTATUS(status)); 
     230                                                rc = WEXITSTATUS(status); 
    230231                                        } else if (WIFSIGNALED(status)) { 
    231232                                                fprintf(stderr, "%s.%d: child signaled: %d\n", 
    232233                                                        __FILE__, __LINE__, 
    233234                                                        WTERMSIG(status)); 
     235                                                rc = 1; 
    234236                                        } else { 
    235237                                                fprintf(stderr, "%s.%d: child died somehow: %d\n", 
    236238                                                        __FILE__, __LINE__, 
    237239                                                        status); 
     240                                                rc = status; 
    238241                                        } 
    239242                                } 
     
    252255        close(fcgi_fd); 
    253256 
    254         return 0; 
     257        return rc; 
    255258} 
    256259