summaryrefslogtreecommitdiff
path: root/lib/ext2fs/flushb.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext2fs/flushb.c')
-rw-r--r--lib/ext2fs/flushb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c
index 282dca37..ed4d3901 100644
--- a/lib/ext2fs/flushb.c
+++ b/lib/ext2fs/flushb.c
@@ -62,12 +62,13 @@ errcode_t ext2fs_sync_device(int fd, int flushb)
if (flushb) {
#ifdef BLKFLSBUF
- ioctl (fd, BLKFLSBUF, 0); /* In case this is a HD */
+ if (ioctl (fd, BLKFLSBUF, 0) == 0)
+ return 0;
#else
#warning BLKFLSBUF not defined
#endif
#ifdef FDFLUSH
- ioctl (fd, FDFLUSH, 0); /* In case this is floppy */
+ ioctl (fd, FDFLUSH, 0); /* In case this is a floppy */
#else
#warning FDFLUSH not defined
#endif