]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_xattr: in debug builds, act normally if CURL_FAKE_XATTR is not set
authorDaniel Stenberg <daniel@haxx.se>
Thu, 28 Mar 2024 12:11:11 +0000 (13:11 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 28 Mar 2024 15:26:15 +0000 (16:26 +0100)
Closes #13220

src/tool_xattr.c

index 9472194faa6a28ea6fda6cef827b801d71ab24a6..a6bd223c365c8334f25f9dd7d21f83b074e3e6a1 100644 (file)
@@ -87,12 +87,11 @@ static int xattr(int fd,
   int err = 0;
   if(value) {
 #ifdef DEBUGBUILD
-    (void)fd;
     if(getenv("CURL_FAKE_XATTR")) {
       printf("%s => %s\n", attr, value);
+      return 0;
     }
-    return 0;
-#else
+#endif
 #ifdef HAVE_FSETXATTR_6
     err = fsetxattr(fd, attr, value, strlen(value), 0, 0);
 #elif defined(HAVE_FSETXATTR_5)
@@ -105,7 +104,6 @@ static int xattr(int fd,
          attribute */
       err = (rc < 0 ? -1 : 0);
     }
-#endif
 #endif
   }
   return err;