diff options
author | 2019-03-30 06:10:31 -0400 | |
---|---|---|
committer | 2019-03-30 06:12:53 -0400 | |
commit | 54ebf6793e3f869ad3883e04bfea1173897cb01a (patch) | |
tree | 2dfc40fa9a57b23bbe3046727765cffa5eff5de9 | |
parent | Prepare release 0.9.4 (diff) | |
download | elfix-54ebf6793e3f869ad3883e04bfea1173897cb01a.tar.gz elfix-54ebf6793e3f869ad3883e04bfea1173897cb01a.tar.bz2 elfix-54ebf6793e3f869ad3883e04bfea1173897cb01a.zip |
install-xattr: report any errors by "stat"
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rwxr-xr-x | misc/install-xattr/checkcopyattrs.sh | 3 | ||||
-rw-r--r-- | misc/install-xattr/install-xattr.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/misc/install-xattr/checkcopyattrs.sh b/misc/install-xattr/checkcopyattrs.sh index 9196795..a9149d7 100755 --- a/misc/install-xattr/checkcopyattrs.sh +++ b/misc/install-xattr/checkcopyattrs.sh @@ -49,6 +49,9 @@ setfattr -n user.pax.flags -v "r" c [ "$(getfattr --only-values -n user.bas f/a)" == "x" ] [ "$(getfattr --only-values -n user.pax.flags f/a)" == "mr" ] +# Check that we can copy large files +truncate -s2G a +./install-xattr a x # The following are just tests to make sure the raw install # options don't get lost in our optargs parsing. diff --git a/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c index 0b5eb25..3e20b63 100644 --- a/misc/install-xattr/install-xattr.c +++ b/misc/install-xattr/install-xattr.c @@ -365,8 +365,10 @@ main(int argc, char* argv[]) if (!opts_target_directory) { target = argv[last]; - if (stat(target, &s) != 0) + if (stat(target, &s) != 0) { + err(1, "failed to stat %s", target); return EXIT_FAILURE; + } target_is_directory = S_ISDIR(s.st_mode); } else { /* target was set above with the -t option */ @@ -381,8 +383,10 @@ main(int argc, char* argv[]) last++; for (i = first; i < last; i++) { - if (stat(argv[i], &s) != 0) + if (stat(argv[i], &s) != 0) { + err(1, "failed to stat %s", argv[i]); return EXIT_FAILURE; + } /* We reproduce install's behavior and skip * all extra directories on the command line * that are not the final target directory. |