From: Goldwyn Rodrigues Date: Thu, 9 Nov 2017 20:54:59 +0000 (-0600) Subject: xfs_io: Disable -V if pwritev is not available X-Git-Tag: v4.14.0-rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68c269ca872a5ab88671273106e4d6b7c3589e0a;p=thirdparty%2Fxfsprogs-dev.git xfs_io: Disable -V if pwritev is not available This results in default case which will display the error message that command is not found. This is required for xfs_io builds which did not support pwritev and an attempt is made to use -V. Signed-off-by: Goldwyn Rodrigues Reviewed-by: Eric Sandeen [sandeen@sandeen.net: restrict default: printf to ifdef'd options] Signed-off-by: Eric Sandeen --- diff --git a/io/pwrite.c b/io/pwrite.c index 71bccccfd..8af607eff 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -312,6 +312,7 @@ pwrite_f( case 'u': uflag = 1; break; +#ifdef HAVE_PWRITEV case 'V': vectors = strtoul(optarg, &sp, 0); if (!sp || sp == optarg) { @@ -320,6 +321,7 @@ pwrite_f( return 0; } break; +#endif case 'w': wflag = 1; break; @@ -334,7 +336,12 @@ pwrite_f( } break; default: - return command_usage(&pwrite_cmd); + /* Handle ifdef'd-out options above */ + if (c != '?') + printf(_("%s: command -%c not supported\n"), argv[0], c); + else + command_usage(&pwrite_cmd); + return 0; } } if (((skip || dflag) && !infile) || (optind != argc - 2))