diff options
-rw-r--r-- | lock.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |