From: Walter Lozano Date: Sat, 18 Dec 2021 01:44:09 +0000 (-0300) Subject: Fix check for tape device X-Git-Tag: v3.6.0~30^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1640%2Fhead;p=thirdparty%2Flibarchive.git Fix check for tape device In b6b423f0 a fallback in tar to stdio was implemented. However, the check for the tape device didn't interpret the correct value returned from access(). Fix the check to implement the fallback to stdio properly. Signed-off-by: Walter Lozano --- diff --git a/tar/bsdtar.c b/tar/bsdtar.c index b55b4c6c0..75249d105 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -216,9 +216,9 @@ main(int argc, char **argv) #if defined(_PATH_DEFTAPE) if (bsdtar->filename == NULL) { #if defined(_WIN32) && !defined(__CYGWIN__) - int tapeExists = _access(_PATH_DEFTAPE, 0); + int tapeExists = !_access(_PATH_DEFTAPE, 0); #else - int tapeExists = access(_PATH_DEFTAPE, F_OK); + int tapeExists = !access(_PATH_DEFTAPE, F_OK); #endif if (tapeExists) { bsdtar->filename = _PATH_DEFTAPE;