diff options
Diffstat (limited to 'src/lib/lockfile.c')
-rw-r--r-- | src/lib/lockfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/lockfile.c b/src/lib/lockfile.c index a93d5f17..75ee2085 100644 --- a/src/lib/lockfile.c +++ b/src/lib/lockfile.c @@ -60,7 +60,7 @@ struct lockfile * lockfile_create() { return NULL; } - if (lseek(lf->fd, LF_SIZE - 1, SEEK_SET) < 0) { + if (ftruncate(lf->fd, LF_SIZE - 1) < 0) { LOG_DBGF("Failed to extend lockfile."); free(lf); return NULL; @@ -99,7 +99,7 @@ struct lockfile * lockfile_open() { return NULL; lf->fd = shm_open(LOCKFILE_NAME, O_RDWR, 0666); - if (lf->fd == -1) { + if (lf->fd < 0) { LOG_DBGF("Could not open lock file."); free(lf); return NULL; |