]> Dogcows Code - chaz/tar/commit
tar: use more-accurate diagnostic when intermediate mkdir fails
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 16 Oct 2010 05:26:14 +0000 (22:26 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 16 Oct 2010 05:26:43 +0000 (22:26 -0700)
commit9447e799ab5faa6e8be43de4000e1061e0879242
tree573841c910e94608bd14c1aa79a1f78ba8d9454a
parent502abd93bd8bfba15677aceb221c4530d257bbab
tar: use more-accurate diagnostic when intermediate mkdir fails

Without this change, if tar tried to extract a file A/B/C, noticed
that A/B didn't exist, attempted to mkdir A/B, and the mkdir
failed, it did not diagnose the mkdir failure, but simply reported
the failure to open A/B/C.  This sometimes led to confusion
because it wasn't clear what tar was trying to do, in particular
that tar tried to mkdir A/B.  With this patch, tar issues two
diagnostics in this case: one for A/B and the other for A/B/C.
Problem reported by Hauke Laging in
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
* gnulib.modules: Remove faccessat.
* src/extract.c (make_directories): New arg INTERDIR_MADE.
Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
as opposed to nonzero iff some directory was created.  All callers
changed.  Simplify the code when mkdir fails, by checking whether
the desired file exists unless errno==EEXIST: this is more robust.
* tests/extrac15.at: New test, to check this.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.
gnulib.modules
src/extract.c
tests/Makefile.am
tests/extrac15.at [new file with mode: 0644]
tests/testsuite.at
This page took 0.02616 seconds and 4 git commands to generate.