From 9ef9cd28d92980b266196925784ab43bb812a839 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 26 Aug 2021 23:53:14 +0200 Subject: lock.c: fix unused-value warning in unlockit(). --- lock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lock.c') diff --git a/lock.c b/lock.c index 5f452b36..57676f89 100644 --- a/lock.c +++ b/lock.c @@ -59,8 +59,11 @@ void fm_lock_setup(struct runctl *ctl) static void unlockit(void) /* must-do actions for exit (but we can't count on being able to do malloc) */ { - if (lockfile && lock_acquired) - unlink(lockfile) && truncate(lockfile, (off_t)0); + if (lockfile && lock_acquired) { + if (unlink(lockfile)) { + (void)truncate(lockfile, (off_t)0); + } + } } void fm_lock_dispose(void) -- cgit v1.2.3