Whamcloud - gitweb
build: update version for Lustre build
[tools/e2fsprogs.git] / misc / util.c
index 7e91509..2898830 100644 (file)
@@ -28,6 +28,9 @@
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <time.h>
 
 #include "et/com_err.h"
@@ -87,7 +90,7 @@ void proceed_question(int delay)
        if (delay > 0) {
                if (setjmp(alarm_env)) {
                        signal(SIGALRM, SIG_IGN);
-                       printf(_("<proceeding>\n"));
+                       printf("%s", _("<proceeding>\n"));
                        return;
                }
                signal(SIGALRM, alarm_signal);
@@ -137,7 +140,7 @@ static void print_ext2_info(const char *device)
                tm = sb->s_wtime;
                printf(_("\tlast modified on %s"), ctime(&tm));
        }
-       ext2fs_close(fs);
+       ext2fs_close_free(&fs);
 }
 
 /*
@@ -195,6 +198,11 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev)
        char *fs_label = NULL;
 
        fd = ext2fs_open_file(device, fl, 0666);
+       if ((fd < 0) && (errno == ENOENT) && (flags & NO_SIZE)) {
+               fprintf(stderr, _("The file %s does not exist and no "
+                                 "size was specified.\n"), device);
+               exit(1);
+       }
        if ((fd < 0) && (errno == ENOENT) && (flags & CREATE_FILE)) {
                fl |= O_CREAT;
                fd = ext2fs_open_file(device, fl, 0666);