[PATCH] Support for nohup in mplayer

Seb <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
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.

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
mplayer-nohup.patch (text/plain, 554 B)
--- 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.