Changeset 2199

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

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

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r2169 r2199  
    3030  * fix dependencies of the parser files in the Makefile 
    3131  * fix server.kbytes-per-second (#1102) 
     32  * let spawn-fcgi propagate exit code from spawned fcgi application 
    3233 
    3334- 1.5.0-r19.. - 
  • trunk/src/spawn-fcgi.c

    r2197 r2199  
    4444int 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) { 
    4545        int fcgi_fd; 
    46         int socket_type, status; 
     46        int socket_type, status, rc = 0; 
    4747        struct timeval tv = { 0, 100 * 1000 }; 
    4848 
     
    232232                                                fprintf(stderr, "%s.%d: child exited with: %d\n", 
    233233                                                        __FILE__, __LINE__, WEXITSTATUS(status)); 
     234                                                rc = WEXITSTATUS(status); 
    234235                                        } else if (WIFSIGNALED(status)) { 
    235236                                                fprintf(stderr, "%s.%d: child signaled: %d\n", 
    236237                                                        __FILE__, __LINE__, 
    237238                                                        WTERMSIG(status)); 
     239                                                rc = 1; 
    238240                                        } else { 
    239241                                                fprintf(stderr, "%s.%d: child died somehow: %d\n", 
    240242                                                        __FILE__, __LINE__, 
    241243                                                        status); 
     244                                                rc = status; 
    242245                                        } 
    243246                                } 
     
    256259        close(fcgi_fd); 
    257260 
    258         return 0; 
     261        return rc; 
    259262} 
    260263