gpm/gpm-1.20.1-close-fds.patch
prockai 4e9de1e65f - fix a bug where gpm daemon kept stdin/out/err open after detaching from
terminal, causing eg. pipes from initscript to hang for the lifetime of
    gpm
2006-09-22 11:52:04 +00:00

15 lines
505 B
Diff

--- gpm-1.20.1/src/startup.c.close-fds 2006-09-22 13:46:19.000000000 +0200
+++ gpm-1.20.1/src/startup.c 2006-09-22 13:46:44.000000000 +0200
@@ -97,6 +97,11 @@
/* is changing to root needed, because of relative paths ? or can we just
* remove and ignore it ?? FIXME */
if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED);
+
+ // close extra fds
+ close(0);
+ close(1);
+ close(2);
atexit(gpm_exited); /* call gpm_exited at the end */
}