diff options
author | Kacper Kowalik (Xarthisius) <xarthisius@gentoo.org> | 2012-11-18 10:49:47 +0100 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-11-18 10:14:19 -0500 |
commit | c189ab04cbaa2f011da0210f2c885e6f693f1d6c (patch) | |
tree | e013ea0467292d81b5318106985d3bfeec6a333f /src/collect/collect.c | |
parent | 2af83cafa0f410edc1d60029edfd457e121114a4 (diff) |
Fix unused result warnings
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/collect/collect.c')
-rw-r--r-- | src/collect/collect.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/collect/collect.c b/src/collect/collect.c index 3c46e40de1..3dd702dfab 100644 --- a/src/collect/collect.c +++ b/src/collect/collect.c @@ -104,7 +104,8 @@ static int prepare(char *dir, char *filename) fprintf(stderr, "Lock taken, wait for %d seconds\n", UDEV_ALARM_TIMEOUT); if (errno == EAGAIN || errno == EACCES) { alarm(UDEV_ALARM_TIMEOUT); - lockf(fd, F_LOCK, 0); + if (lockf(fd, F_LOCK, 0) == -1) + fprintf(stderr, "Failed to acquire lock on %s\n", buf); if (debug) fprintf(stderr, "Acquired lock on %s\n", buf); } else { @@ -476,10 +477,12 @@ int main(int argc, char **argv) kickout(); lseek(fd, 0, SEEK_SET); - ftruncate(fd, 0); + if (ftruncate(fd, 0) == -1) + fprintf(stderr, "Failed to truncate '%s'\n", checkpoint); ret = missing(fd); - lockf(fd, F_ULOCK, 0); + if (lockf(fd, F_ULOCK, 0) == -1) + fprintf(stderr, "Failed to release lock from '%s'\n", checkpoint); close(fd); out: if (debug) |