Whamcloud - gitweb
libext2fs: find/alloc a range of empty blocks
[tools/e2fsprogs.git] / lib / ext2fs / flushb.c
index f0630ea..98821fc 100644 (file)
@@ -5,11 +5,12 @@
  * Copyright (C) 2000 Theodore Ts'o.
  *
  * %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
  * %End-Header%
  */
 
+#include "config.h"
 #include <stdio.h>
 #if HAVE_ERRNO_H
 #include <errno.h>
@@ -65,17 +66,13 @@ errcode_t ext2fs_sync_device(int fd, int flushb)
 #ifdef BLKFLSBUF
                if (ioctl (fd, BLKFLSBUF, 0) == 0)
                        return 0;
-#else
-#ifdef __GNUC__
- #warning BLKFLSBUF not defined
-#endif /* __GNUC__ */
+#elif defined(__linux__)
+#warning BLKFLSBUF not defined
 #endif
 #ifdef FDFLUSH
-               ioctl (fd, FDFLUSH, 0);   /* In case this is a floppy */
-#else
-#ifdef __GNUC__
- #warning FDFLUSH not defined
-#endif /* __GNUC__ */
+               return ioctl(fd, FDFLUSH, 0);   /* In case this is a floppy */
+#elif defined(__linux__)
+#warning FDFLUSH not defined
 #endif
        }
        return 0;