2001-01-11 <tytso@snap.thunk.org>
+ * main.c (main): Use ext2fs_sync_device() instead of calling the
+ BLKFLSBUF ioctl directly.
+
* extent.c, main.c, resize2fs.c: Change ino_t to ext2_ino_t.
2001-01-01 <tytso@snap.thunk.org>
extern int optind;
#endif
#include <fcntl.h>
-#include <sys/ioctl.h>
#include "resize2fs.h"
check_mount(device_name);
if (flush) {
-#ifdef BLKFLSBUF
fd = open(device_name, O_RDONLY, 0);
if (fd < 0) {
device_name);
exit(1);
}
- if (ioctl(fd, BLKFLSBUF, 0) < 0) {
- com_err("BLKFLSBUF", errno,
+ retval = ext2fs_sync_device(fd, 1);
+ if (retval) {
+ com_err(argv[0], retval,
_("while trying to flush %s"),
device_name);
exit(1);
}
close(fd);
-#else
- fprintf(stderr, _("BLKFLSBUF not supported\n"));
- exit(1);
-#endif /* BLKFLSBUF */
}
if (flags & RESIZE_DEBUG_IO) {