--- hdparm.c +++ hdparm.c @@ -292,11 +292,10 @@ void flush_buffer_cache (int fd) { fsync (fd); /* flush buffers */ - if (ioctl(fd, BLKFLSBUF, NULL)) /* do it again, big time */ - perror("BLKFLSBUF failed"); + ioctl(fd, BLKFLSBUF, NULL); /* do it again, big time */ #ifdef HDIO_DRIVE_CMD - if (ioctl(fd, HDIO_DRIVE_CMD, NULL) && errno != EINVAL) /* await completion */ - perror("HDIO_DRIVE_CMD(null) (wait for flush complete) failed"); + if (errno != EINVAL && errno != EOPNOTSUPP) + ioctl(fd, HDIO_DRIVE_CMD, NULL);/* await completion */ #endif }