Sat, 14 May 2022 15:21:59 +0200
check cgi exit code
src/server/safs/cgi.c | file | annotate | diff | comparison | revisions |
--- a/src/server/safs/cgi.c Sat May 14 12:51:05 2022 +0200 +++ b/src/server/safs/cgi.c Sat May 14 15:21:59 2022 +0200 @@ -191,7 +191,12 @@ log_ereport(LOG_FAILURE, "cgi-send: kill script: %s", path); kill(cgip.pid, SIGKILL); } - cgi_close(&cgip); // TODO: check return value + + int exit_code = cgi_close(&cgip); + if(exit_code != 0) { + log_ereport(LOG_FAILURE, "send-cgi: script: %s exited with code %d", path, exit_code); + ret = REQ_ABORTED; + } cgi_parser_free(parser); return result; @@ -269,7 +274,7 @@ system_close(p->out[1]); } - return 0; + return status; } CGIResponseParser* cgi_parser_new(Session *sn, Request *rq) {