diff --git a/dwmblocks.c b/dwmblocks.c index d592a5b..744426c 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -326,8 +326,7 @@ writepid() int fd; struct flock fl; - fd = open(LOCKFILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (fd == -1) { + if ((fd = open(LOCKFILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) { perror("writepid - open"); exit(1); } diff --git a/sigdwmblocks.c b/sigdwmblocks.c index 7739b49..0daab5f 100644 --- a/sigdwmblocks.c +++ b/sigdwmblocks.c @@ -50,8 +50,7 @@ sendsignal(int sig, union sigval sv) int fd; struct flock fl; - fd = open(LOCKFILE, O_RDONLY); - if (fd == -1) { + if ((fd = open(LOCKFILE, O_RDONLY)) == -1) { if (errno == ENOENT) { fputs("Error: no running instance of dwmblocks.\n", stderr); exit(3);