Package: osdsh / 0.7.0-10.2

10-osdsh-create-fifo-before-fork.dpatch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Peter Colberg <peterco@gmx.net>
Subject: No description.

--- a/src/osdsh/controlsh.c
+++ b/src/osdsh/controlsh.c
@@ -213,10 +213,6 @@
 	initialize_osd(&settings);
 	load_basic_plugins();
 
-    /* create the fifo file*/
-	unlink(fifo_file);
-	umask(0);
-	mknod(fifo_file, S_IFIFO|0600, 0);
 	    /*open and read the fifo*/
 	while (settings.displaying) {
 		fp = fopen(fifo_file, "r");
--- a/src/osdsh/osdsh.c
+++ b/src/osdsh/osdsh.c
@@ -153,6 +153,7 @@
 
     char pid_file[PATH_MAX+1];
     FILE *fp;
+    char fifo_file[PATH_MAX +1];
 
     set_defaults(&settings);
     initialize_osd(&settings);
@@ -180,6 +181,12 @@
 	fclose(fp);
     }
 
+    /* create the fifo file*/
+    sprintf(fifo_file, "%s.%d", OSD_FIFO_PATH, getuid());
+    unlink(fifo_file);
+    umask(0);
+    mknod(fifo_file, S_IFIFO|0600, 0);
+
     if((childpid=fork())<0) {
 	perror("fork");
 	exit(1);