[PATCH] Core: remove unused FIOASYNC.

Ian Gudger igudger at google.com
Mon Jun 25 18:16:12 UTC 2018


# HG changeset patch
# User Ian Gudger <igudger at google.com>
# Date 1529449008 25200
#      Tue Jun 19 15:56:48 2018 -0700
# Node ID 9427538acbc50142afbe91a11a1d4f907a00d257
# Parent  118885f7a5774962f1145693d9c26a4c199ca6ea
Core: remove unused FIOASYNC.

FIOASYNC, F_SETOWN and SIGIO seem to no longer serve any function.

diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c
--- a/src/os/unix/ngx_process.c
+++ b/src/os/unix/ngx_process.c
@@ -71,8 +71,6 @@ ngx_signal_t  signals[] = {

     { SIGINT, "SIGINT", "", ngx_signal_handler },

-    { SIGIO, "SIGIO", "", ngx_signal_handler },
-
     { SIGCHLD, "SIGCHLD", "", ngx_signal_handler },

     { SIGSYS, "SIGSYS, SIG_IGN", "", NULL },
@@ -87,7 +85,6 @@ ngx_pid_t
 ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data,
     char *name, ngx_int_t respawn)
 {
-    u_long     on;
     ngx_pid_t  pid;
     ngx_int_t  s;

@@ -142,21 +139,6 @@ ngx_spawn_process(ngx_cycle_t *cycle, ng
             return NGX_INVALID_PID;
         }

-        on = 1;
-        if (ioctl(ngx_processes[s].channel[0], FIOASYNC, &on) == -1) {
-            ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
-                          "ioctl(FIOASYNC) failed while spawning
\"%s\"", name);
-            ngx_close_channel(ngx_processes[s].channel, cycle->log);
-            return NGX_INVALID_PID;
-        }
-
-        if (fcntl(ngx_processes[s].channel[0], F_SETOWN, ngx_pid) == -1) {
-            ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
-                          "fcntl(F_SETOWN) failed while spawning
\"%s\"", name);
-            ngx_close_channel(ngx_processes[s].channel, cycle->log);
-            return NGX_INVALID_PID;
-        }
-
         if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) {
             ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
                           "fcntl(FD_CLOEXEC) failed while spawning \"%s\"",
@@ -394,10 +376,6 @@ ngx_signal_handler(int signo, siginfo_t
             ngx_sigalrm = 1;
             break;

-        case SIGIO:
-            ngx_sigio = 1;
-            break;
-
         case SIGCHLD:
             ngx_reap = 1;
             break;
@@ -433,8 +411,6 @@ ngx_signal_handler(int signo, siginfo_t

         case ngx_signal_value(NGX_RECONFIGURE_SIGNAL):
         case ngx_signal_value(NGX_CHANGEBIN_SIGNAL):
-        case SIGIO:
-            action = ", ignoring";
             break;
         }

diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -34,7 +34,6 @@ ngx_pid_t     ngx_pid;
 ngx_pid_t     ngx_parent;

 sig_atomic_t  ngx_reap;
-sig_atomic_t  ngx_sigio;
 sig_atomic_t  ngx_sigalrm;
 sig_atomic_t  ngx_terminate;
 sig_atomic_t  ngx_quit;
@@ -88,7 +87,6 @@ ngx_master_process_cycle(ngx_cycle_t *cy
     sigemptyset(&set);
     sigaddset(&set, SIGCHLD);
     sigaddset(&set, SIGALRM);
-    sigaddset(&set, SIGIO);
     sigaddset(&set, SIGINT);
     sigaddset(&set, ngx_signal_value(NGX_RECONFIGURE_SIGNAL));
     sigaddset(&set, ngx_signal_value(NGX_REOPEN_SIGNAL));
diff --git a/src/os/unix/ngx_process_cycle.h b/src/os/unix/ngx_process_cycle.h
--- a/src/os/unix/ngx_process_cycle.h
+++ b/src/os/unix/ngx_process_cycle.h
@@ -47,7 +47,6 @@ extern ngx_uint_t      ngx_daemonized;
 extern ngx_uint_t      ngx_exiting;

 extern sig_atomic_t    ngx_reap;
-extern sig_atomic_t    ngx_sigio;
 extern sig_atomic_t    ngx_sigalrm;
 extern sig_atomic_t    ngx_quit;
 extern sig_atomic_t    ngx_debug_quit;


More information about the nginx-devel mailing list