1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 078_locking_fix_1.dpatch
8 diff -Naur .B/daemon/spawn.c .A/daemon/spawn.c
9 --- .B/daemon/spawn.c 2007-01-07 21:36:36.000000000 +0000
10 +++ .A/daemon/spawn.c 2007-01-07 21:36:36.000000000 +0000
12 sigfillset(&allsignals);
13 sigprocmask(SIG_BLOCK, &allsignals, &oldsig);
19 + sigprocmask(SIG_SETMASK, &oldsig, NULL);
25 - sigprocmask(SIG_SETMASK, &oldsig, NULL);
27 - } else if (f == 0) {
31 dup2(pipefd[1], STDOUT_FILENO);
38 sigprocmask(SIG_SETMASK, &oldsig, NULL);
42 if (waitpid(f, &status, 0) != f)
43 status = -1; /* waitpid() failed */
45 - sigprocmask(SIG_SETMASK, &oldsig, NULL);
50 + sigprocmask(SIG_SETMASK, &oldsig, NULL);
55 diff -Naur .B/lib/lock.c .A/lib/lock.c
56 --- .B/lib/lock.c 2005-01-17 15:09:28.000000000 +0000
57 +++ .A/lib/lock.c 2007-01-07 21:36:36.000000000 +0000
60 static int wait_for_lockf(const char *lockf)
62 - struct timespec t = { 0, WAIT_INTERVAL };
64 - int ts_size = sizeof(struct timespec);
65 int tries = WAIT_TRIES;
69 while (tries-- && !status) {
70 status = stat(lockf, &st);
72 + struct timespec t = { 0, WAIT_INTERVAL };
75 while (nanosleep(&t, &r) == -1 && errno == EINTR) {
78 - memcpy(&t, &r, ts_size);
79 + memcpy(&t, &r, sizeof(struct timespec));