From 7e121a6b631f1ad3ea5811350555308dc732980d Mon Sep 17 00:00:00 2001 From: Ashish Kumar Yadav Date: Sun, 10 Jan 2021 13:25:58 +0530 Subject: [PATCH] Consistency --- dwmblocks.c | 3 +-- sigdwmblocks.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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);