Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: GNU nohup oddness



On Dec 7, 10:24am, Clint Adams wrote:
} Subject: Re: GNU nohup oddness
}
} > (3) In Src/init.c:init_signals(), zsh explicitly installs a SIGHUP
} >     handler, even in non-interactive shells.  It has done so for a
} >     very long time -- as far back as recorded in my CVS of 3.0.x,
} >     which means prior to 27-Jun-97.
} 
} So is this the right thing to do?

[Patch moves install_handler(SIGHUP) call to `if (interact)' block]

I'm not certain.  Probably more correct would be something like:

@@ -870,7 +897,8 @@
     signal_ignore(SIGQUIT);
 #endif
 
-    install_handler(SIGHUP);
+    if (signal_ignore(SIGHUP) != SIG_IGN)
+	install_handler(SIGHUP);
     install_handler(SIGCHLD);
 #ifdef SIGWINCH
     install_handler(SIGWINCH);


Or maybe even:

@@ -870,7 +897,10 @@
     signal_ignore(SIGQUIT);
 #endif
 
-    install_handler(SIGHUP);
+    if (signal_ignore(SIGHUP) == SIG_IGN)
+	opts[HUP] = 0;
+    else
+	install_handler(SIGHUP);
     install_handler(SIGCHLD);
 #ifdef SIGWINCH
     install_handler(SIGWINCH);


Does anybody else have an opinion?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author