blob: 71b6556a601efd27d947862f41250371f0af50e4 (
plain)
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
|
diff -NurpP util-vserver-0.30.208/src/lockfile.c util-vserver-0.30.208-lockfix/src/lockfile.c
--- util-vserver-0.30.208/src/lockfile.c 2004-04-13 10:27:50.000000000 +0200
+++ util-vserver-0.30.208-lockfix/src/lockfile.c 2005-09-30 10:24:09.102509750 +0200
@@ -32,6 +32,8 @@
#include <sys/file.h>
#include <sys/param.h>
+char *argv1;
+
static void
showHelp(char const *cmd)
{
@@ -83,6 +85,7 @@ alarmFunc(int UNUSED sig)
static void
quitFunc(int UNUSED sig)
{
+ unlink(argv1);
_exit(0);
}
@@ -107,7 +110,9 @@ int main(int argc, char *argv[])
end_time = time(0);
if (argc==idx+3) end_time += atoi(argv[idx+2]);
else end_time += 300;
-
+
+ argv1 = argv[idx];
+
if ((sync_fd=open(argv[idx+1], O_WRONLY))==-1)
perror("lockfile: open(<syncpipe>)");
else if ((fd=open(argv[idx], O_CREAT|O_RDONLY|O_NOFOLLOW|O_NONBLOCK, 0644))==-1)
@@ -134,6 +139,7 @@ int main(int argc, char *argv[])
close(sync_fd);
while (getppid()==ppid) sleep(10);
+ unlink(argv[idx]);
return EXIT_SUCCESS;
}
|