forked from pool/hdparm
17 lines
543 B
Diff
17 lines
543 B
Diff
--- hdparm.c
|
|
+++ hdparm.c
|
|
@@ -269,10 +269,9 @@
|
|
void flush_buffer_cache (int fd)
|
|
{
|
|
fsync (fd); /* flush buffers */
|
|
- if (ioctl(fd, BLKFLSBUF, NULL)) /* do it again, big time */
|
|
- perror("BLKFLSBUF failed");
|
|
- if (do_drive_cmd(fd, NULL) && errno != EINVAL) /* await completion */
|
|
- perror("HDIO_DRIVE_CMD(null) (wait for flush complete) failed");
|
|
+ ioctl(fd, BLKFLSBUF, NULL); /* do it again, big time */
|
|
+ if (errno != EINVAL && errno != EOPNOTSUPP)
|
|
+ do_drive_cmd(fd, NULL); /* await completion */
|
|
}
|
|
|
|
int seek_to_zero (int fd)
|