$LFS getstripe -m $DIR/$tdir/$tfile $DIR/$tdir/$tfile.2
local rc=$?
(( rc == 2 )) || error "getstripe did not return ENOENT"
+
+ local err_msg=$($LFS getstripe $DIR/$tdir/typo $DIR/$tdir/$tfile \
+ 2>&1 > /dev/null)
+ [[ $err_msg =~ "typo" ]] ||
+ error "expected message with correct filename, got '$err_msg'"
}
run_test 27ga "$LFS getstripe with missing file (should return error)"
local dir1=$dir/d1
local dir2=$dir/d2
local nfiles
+ local err_msg
test_mkdir -p $dir
nfiles=$($LFS find -type f $dir1 $dir2 | wc -l)
(( $nfiles == 2 )) ||
error "(3) lfs find expected 2 files, got $nfiles"
+
+ err_msg=$($LFS find $dir1/typo $dir1/f 2>&1 > /dev/null)
+ [[ $err_msg =~ "No such file or directory" ]] ||
+ error "expected standard error message, got: '$err_msg'"
}
run_test 56ef "lfs find with multiple paths"
int optidx = 0;
int pathstart = -1;
int pathend = -1;
- int pathbad = -1;
int neg_opt = 0;
time_t *xtime;
int *xsign;
do {
rc = llapi_find(argv[pathstart], ¶m);
- if (rc && !ret) {
- ret = rc;
- pathbad = pathstart;
+ if (rc) {
+ if (!ret)
+ ret = rc;
+
+ fprintf(stderr, "%s: failed for '%s': %s\n",
+ progname, argv[pathstart], strerror(-rc));
}
} while (++pathstart < pathend);
- if (ret)
- fprintf(stderr, "%s: failed for '%s': %s\n",
- progname, argv[pathbad], strerror(-rc));
-
err:
if (param.fp_obd_uuid && param.fp_num_alloc_obds)
free(param.fp_obd_uuid);
rc2 = llapi_getstripe(argv[pathstart], param);
if (rc2) {
fprintf(stderr, "%s: %s for '%s' failed: %s\n",
- progname, argv[0], argv[optind - 1],
+ progname, argv[0], argv[pathstart],
strerror(-rc2));
if (!rc)
rc = rc2;
fprintf(stderr,
"%s setdirstripe: cannot create dir '%s': %s\n",
progname, dname, strerror(-result));
- } while (!result && (dname = argv[++optind]));
+ } while ((dname = argv[++optind]));
if (mode_opt)
umask(previous_mode);