aboutsummaryrefslogtreecommitdiffstats
path: root/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lock.c')
-rw-r--r--lock.c7
1 files changed, 5 insertions, 2 deletions
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)