summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-queue-private.c
diff options
context:
space:
mode:
authorKacper Kowalik (Xarthisius) <xarthisius@gentoo.org>2012-11-18 10:49:47 +0100
committerAnthony G. Basile <blueness@gentoo.org>2012-11-18 10:14:19 -0500
commitc189ab04cbaa2f011da0210f2c885e6f693f1d6c (patch)
treee013ea0467292d81b5318106985d3bfeec6a333f /src/libudev/libudev-queue-private.c
parent2af83cafa0f410edc1d60029edfd457e121114a4 (diff)
Fix unused result warnings
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/libudev-queue-private.c')
-rw-r--r--src/libudev/libudev-queue-private.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libudev/libudev-queue-private.c b/src/libudev/libudev-queue-private.c
index 80d7ceef2b..51a1d672be 100644
--- a/src/libudev/libudev-queue-private.c
+++ b/src/libudev/libudev-queue-private.c
@@ -224,8 +224,8 @@ static int rebuild_queue_file(struct udev_queue_export *udev_queue_export)
if (new_queue_file == NULL)
goto error;
seqnum = udev_queue_export->seqnum_max;
- fwrite(&seqnum, 1, sizeof(unsigned long long int), new_queue_file);
-
+ if (fwrite(&seqnum, 1, sizeof(unsigned long long int), new_queue_file) != sizeof(unsigned long long int))
+ goto error;
/* copy unfinished events only to the new file */
if (devpaths != NULL) {
for (i = devpaths->devpaths_first; i < devpaths->devpaths_size; i++) {
@@ -239,9 +239,12 @@ static int rebuild_queue_file(struct udev_queue_export *udev_queue_export)
err = udev_queue_read_devpath(udev_queue_export->queue_file, devpath, sizeof(devpath));
devpath_len = err;
- fwrite(&seqnum, sizeof(unsigned long long int), 1, new_queue_file);
- fwrite(&devpath_len, sizeof(unsigned short), 1, new_queue_file);
- fwrite(devpath, 1, devpath_len, new_queue_file);
+ if (fwrite(&seqnum, sizeof(unsigned long long int), 1, new_queue_file) != 1)
+ goto error;
+ if (fwrite(&devpath_len, sizeof(unsigned short), 1, new_queue_file) != 1)
+ goto error;
+ if (fwrite(devpath, 1, devpath_len, new_queue_file) != devpath_len)
+ goto error;
}
seqnum++;
}