summaryrefslogtreecommitdiff
path: root/src/daemontools-extras/s6-setlock.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-12 23:16:36 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-12 23:16:36 +0000
commitbf6d072124a960d3b84ae39cd15c5aeca2e41c88 (patch)
treec082150f61e67d929b1baca2f5c6104fe959ccac /src/daemontools-extras/s6-setlock.c
parent81c7a02ec870ef3dba9f8b8f8dbecbd119e5ea47 (diff)
downloads6-bf6d072124a960d3b84ae39cd15c5aeca2e41c88.tar.xz
Types fix, first pass
Diffstat (limited to 'src/daemontools-extras/s6-setlock.c')
-rw-r--r--src/daemontools-extras/s6-setlock.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/daemontools-extras/s6-setlock.c b/src/daemontools-extras/s6-setlock.c
index 15970ed..27b6b23 100644
--- a/src/daemontools-extras/s6-setlock.c
+++ b/src/daemontools-extras/s6-setlock.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
@@ -56,7 +57,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
iopause_fd x = { .events = IOPAUSE_READ } ;
tain_t deadline ;
int p[2] ;
- unsigned int pid ;
+ pid_t pid ;
char c ;
tain_now_g() ;
tain_from_millisecs(&deadline, timeout) ;
@@ -66,6 +67,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
x.fd = p[0] ;
for (;;)
{
+ ssize_t rr ;
register int r = iopause_g(&x, 1, &deadline) ;
if (r < 0) strerr_diefu1sys(111, "iopause") ;
if (!r)
@@ -74,9 +76,9 @@ int main (int argc, char const *const *argv, char const *const *envp)
errno = ETIMEDOUT ;
strerr_diefu1sys(1, "acquire lock") ;
}
- r = sanitize_read(fd_read(p[0], &c, 1)) ;
- if (r < 0) strerr_diefu1sys(111, "read ack from helper") ;
- if (r) break ;
+ rr = sanitize_read(fd_read(p[0], &c, 1)) ;
+ if (rr < 0) strerr_diefu1sys(111, "read ack from helper") ;
+ if (rr) break ;
}
if (c != '!') strerr_dief1x(111, "helper sent garbage ack") ;
fd_close(p[0]) ;