aboutsummaryrefslogtreecommitdiff
path: root/misc/mke2fs.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-02-10 18:20:58 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-02-10 18:20:58 -0500
commitcc84d866e2f29d92b5a732fead4df2dd9f814f2b (patch)
treea6df81da507c60d8253b436cf694ba03b6c9ee52 /misc/mke2fs.c
parent3067d96a2d226e2d1b6c97501be6aaa8e85140c3 (diff)
parent9080695a4ec602b1102d836b44b18c2ec692c12e (diff)
downloade2fsprogs-cc84d866e2f29d92b5a732fead4df2dd9f814f2b.tar.gz
Merge branch 'maint' into next
Conflicts: e2fsck/pass1.c
Diffstat (limited to 'misc/mke2fs.c')
-rw-r--r--misc/mke2fs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 34a3491d..4b133674 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -47,6 +47,7 @@ extern int optind;
#endif
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <libgen.h>
#include <limits.h>
#include <blkid/blkid.h>
@@ -1035,6 +1036,11 @@ static int ext2fs_get_device_geometry(const char *file,
blkid_topology tp;
unsigned long min_io;
unsigned long opt_io;
+ struct stat statbuf;
+
+ /* Nothing to do for a regular file */
+ if (!stat(file, &statbuf) && S_ISREG(statbuf.st_mode))
+ return 0;
pr = blkid_new_probe_from_filename(file);
if (!pr)
@@ -1630,7 +1636,7 @@ got_size:
retval = ext2fs_get_device_geometry(device_name, &fs_param);
if (retval < 0) {
fprintf(stderr,
- _("warning: Unable to get device geometry for %s"),
+ _("warning: Unable to get device geometry for %s\n"),
device_name);
} else if (retval) {
printf(_("%s alignment is offset by %lu bytes.\n"),