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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2198 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.20
Elan Ruusamäe 15 years ago
parent 00e5a032d6
commit 0f515626e4

@ -26,6 +26,7 @@ NEWS
* Disable logging to access.log if filename is an empty string
* Implement a clean way to open /dev/null and use it to close stdin/out/err in the needed places (#624)
* merge spawn-fcgi changes from trunk (from @2191)
* let spawn-fcgi propagate exit code from spawned fcgi application
- 1.4.19 - 2008-03-10

@ -39,7 +39,7 @@ typedef int socklen_t;
#ifdef HAVE_SYS_UN_H
int 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) {
int fcgi_fd;
int socket_type, status;
int socket_type, status, rc = 0;
struct timeval tv = { 0, 100 * 1000 };
struct sockaddr_un fcgi_addr_un;
@ -227,14 +227,17 @@ int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned sh
if (WIFEXITED(status)) {
fprintf(stderr, "%s.%d: child exited with: %d\n",
__FILE__, __LINE__, WEXITSTATUS(status));
rc = WEXITSTATUS(status);
} else if (WIFSIGNALED(status)) {
fprintf(stderr, "%s.%d: child signaled: %d\n",
__FILE__, __LINE__,
WTERMSIG(status));
rc = 1;
} else {
fprintf(stderr, "%s.%d: child died somehow: %d\n",
__FILE__, __LINE__,
status);
rc = status;
}
}
@ -251,7 +254,7 @@ int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned sh
close(fcgi_fd);
return 0;
return rc;
}

Loading…
Cancel
Save