All kxsocketpair() callers use the same arguments, so don't pass them.

This commit is contained in:
kristapsdz committed 2020-07-17 14:03:24 +00:00
1 parent ee09bfac8a
commit 0f7f5071ab
4 files changed
+8 -9

No files matched your search

+1 -1
View File
@@ -90,7 +90,7 @@ int ksandbox_seccomp_init_child(enum sandtype);
#endif
void kreq_free(struct kreq *);
enum kcgi_err kxsocketpair(int, int, int, int[2]);
enum kcgi_err kxsocketpair(int[2]);
enum kcgi_err kxsocketprep(int);
enum kcgi_err kxwaitpid(pid_t);
+3 -3
View File
@@ -414,10 +414,10 @@ khttp_fcgi_initx(struct kfcgi **fcgip,
sigprocmask(SIG_BLOCK, &mask, NULL);
sig = 0;
if (kxsocketpair(AF_UNIX, SOCK_STREAM, 0, work_ctl) != KCGI_OK)
if (kxsocketpair(work_ctl) != KCGI_OK)
return KCGI_SYSTEM;
if (kxsocketpair(AF_UNIX, SOCK_STREAM, 0, work_dat) != KCGI_OK) {
if (kxsocketpair(work_dat) != KCGI_OK) {
close(work_ctl[KWORKER_PARENT]);
close(work_ctl[KWORKER_CHILD]);
return KCGI_SYSTEM;
@@ -482,7 +482,7 @@ khttp_fcgi_initx(struct kfcgi **fcgip,
close(work_dat[KWORKER_CHILD]);
close(work_ctl[KWORKER_CHILD]);
if (kxsocketpair(AF_UNIX, SOCK_STREAM, 0, sock_ctl) != KCGI_OK) {
if (kxsocketpair(sock_ctl) != KCGI_OK) {
close(work_dat[KWORKER_PARENT]);
close(work_ctl[KWORKER_PARENT]);
kxwaitpid(work_pid);
+1 -2
View File
@@ -958,8 +958,7 @@ khttp_parsex(struct kreq *req,
if (kxsocketprep(STDIN_FILENO) != KCGI_OK)
return KCGI_SYSTEM;
if (kxsocketpair(AF_UNIX, SOCK_STREAM, 0, work_dat) != KCGI_OK)
if (kxsocketpair(work_dat) != KCGI_OK)
return KCGI_SYSTEM;
if ((work_pid = fork()) == -1) {
+3 -3
View File
@@ -181,18 +181,18 @@ kxsocketprep(int sock)
}
/*
* Create a non-blocking socketpair.
* Create a non-blocking socketpair (AF_UNIX, SOCK_STREAM, protocol 0).
* Return KCGI_ENFILE on temporary failure, KCGI_SYSTEM on fatal error,
* KCGI_OK on success.
* The input socket pair is only valid on success.
*/
enum kcgi_err
kxsocketpair(int domain, int type, int protocol, int sock[2])
kxsocketpair(int sock[2])
{
int rc;
enum kcgi_err er;
rc = socketpair(domain, type, protocol, sock);
rc = socketpair(AF_UNIX, SOCK_STREAM, 0, sock);
if (rc == -1 && (EMFILE == errno || ENFILE == errno)) {
kutil_warn(NULL, NULL, "socketpair");
return KCGI_ENFILE;