[MPlayer-dev-eng] [PATCH] Support for nohup in mplayer

Seb sbb at tuxfamily.org
Mon Jul 25 15:39:47 EEST 2016


Hello,

Here is attached a little patch allowing mplayer to inherit a
nohup setting. This can be useful when this one is used in slave
mode and you don't want xinit or xterm to shut it down.

++
Seb.
-------------- next part --------------
--- mplayer.c.orig	2016-03-06 14:00:49.000000000 +0100
+++ mplayer.c	2016-07-25 11:39:10.234979743 +0200
@@ -3048,7 +3048,8 @@
     //========= Catch terminate signals: ================
     // terminate requests:
     signal(SIGTERM, exit_sighandler); // kill
-    signal(SIGHUP, exit_sighandler); // kill -HUP  /  xterm closed
+    if (signal(SIGHUP, exit_sighandler) == SIG_IGN) // kill -HUP  /  xterm closed
+       signal(SIGHUP, SIG_IGN); // honor the inherited "nohup" setting.
 
     signal(SIGINT, exit_sighandler); // Interrupt from keyboard
 


More information about the MPlayer-dev-eng mailing list