Suppress two warnings when compiling with tcc

While there, add some comments to better understand the code flow in
localcgi_post().
This commit is contained in:
Rene Kita
2021-10-09 12:11:46 +02:00
parent f7601b4555
commit 89295504fc
2 changed files with 13 additions and 1 deletions

View File

@@ -380,17 +380,19 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
cgi_dir = mydirname(file);
#endif
cgi_basename = mybasename(file);
pid = open_pipe_rw(&fr, NULL);
pid = open_pipe_rw(&fr, NULL); /* open_pipe_rw() forks */
/* Don't invoke gc after here, or the program might crash in some platforms */
if (pid < 0) {
if (fw)
fclose(fw);
return NULL;
} else if (pid) {
/* parent */
if (fw)
fclose(fw);
return fr;
}
/* child */
setup_child(TRUE, 2, fw ? fileno(fw) : -1);
set_cgi_environ(name, file, uri);
@@ -433,4 +435,9 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
file, cgi_basename, strerror(errno));
exit(1);
#endif
/*
* Suppress compiler warning: function might return no value
* This code is never reached.
*/
return NULL;
}