]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix check for tape device 1640/head
authorWalter Lozano <walter.lozano@collabora.com>
Sat, 18 Dec 2021 01:44:09 +0000 (22:44 -0300)
committerWalter Lozano <walter.lozano@collabora.com>
Tue, 21 Dec 2021 16:27:45 +0000 (13:27 -0300)
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 <walter.lozano@collabora.com>
tar/bsdtar.c

index b55b4c6c0aa68fd353fb57c0438e7f455eaed0f1..75249d1052c3680c1df1c87fa6f461068a3e4f43 100644 (file)
@@ -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;