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:
9
local.c
9
local.c
@@ -380,17 +380,19 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
|
|||||||
cgi_dir = mydirname(file);
|
cgi_dir = mydirname(file);
|
||||||
#endif
|
#endif
|
||||||
cgi_basename = mybasename(file);
|
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 */
|
/* Don't invoke gc after here, or the program might crash in some platforms */
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
if (fw)
|
if (fw)
|
||||||
fclose(fw);
|
fclose(fw);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (pid) {
|
} else if (pid) {
|
||||||
|
/* parent */
|
||||||
if (fw)
|
if (fw)
|
||||||
fclose(fw);
|
fclose(fw);
|
||||||
return fr;
|
return fr;
|
||||||
}
|
}
|
||||||
|
/* child */
|
||||||
setup_child(TRUE, 2, fw ? fileno(fw) : -1);
|
setup_child(TRUE, 2, fw ? fileno(fw) : -1);
|
||||||
|
|
||||||
set_cgi_environ(name, file, uri);
|
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));
|
file, cgi_basename, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
|
* Suppress compiler warning: function might return no value
|
||||||
|
* This code is never reached.
|
||||||
|
*/
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
5
main.c
5
main.c
@@ -394,6 +394,11 @@ die_oom(size_t bytes)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "Out of memory: %lu bytes unavailable!\n", (unsigned long)bytes);
|
fprintf(stderr, "Out of memory: %lu bytes unavailable!\n", (unsigned long)bytes);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
/*
|
||||||
|
* Suppress compiler warning: function might return no value
|
||||||
|
* This code is never reached.
|
||||||
|
*/
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Reference in New Issue
Block a user