From: Nathan Scott Date: Tue, 5 Aug 2003 07:14:10 +0000 (+0000) Subject: Fix xfs_io so that it can take input from non-XFS files X-Git-Tag: v2.6.0~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db0bb90c118a18b680600346379b69e21e744adc;p=thirdparty%2Fxfsprogs-dev.git Fix xfs_io so that it can take input from non-XFS files --- diff --git a/io/open.c b/io/open.c index 54919459d..01089aa27 100644 --- a/io/open.c +++ b/io/open.c @@ -74,6 +74,9 @@ openfile( perror(path); return -1; } + if (!geom) + return fd; + if (!platform_test_xfs_fd(fd)) { fprintf(stderr, _("%s: specified file " "[\"%s\"] is not on an XFS filesystem\n"), diff --git a/io/pwrite.c b/io/pwrite.c index aa0d28028..6d4079e72 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -101,7 +101,6 @@ pwrite_f( ssize_t count, total; unsigned int seed = 0xcdcdcdcd; unsigned int bsize = 4096; - xfs_fsop_geom_t geometry; char *sp, *infile = NULL; int c, fd = -1, dflag = 0; @@ -160,7 +159,7 @@ pwrite_f( return 0; if (infile && - ((fd = openfile(infile, &geometry, 0, 0, dflag, 1, 0, 0, 0)) < 0)) + ((fd = openfile(infile, NULL, 0, 0, dflag, 1, 0, 0, 0)) < 0)) return 0; if (!write_buffer(offset, count, bsize, fd, skip, &total)) {