]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: use more appropriate return code
authorMichal Sekletar <msekleta@redhat.com>
Mon, 9 Sep 2024 16:17:18 +0000 (18:17 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 30 Oct 2024 12:20:40 +0000 (12:20 +0000)
src/coredump/coredump.c

index 74a29d7ff2bbd6b90068fef16ad8f1a99c2f5988..5b022de2d10ad527b2377e531fb66d9b05b2973b 100644 (file)
@@ -1662,11 +1662,11 @@ static int gather_pid_mount_tree_fd(const Context *context) {
 
         /* Don't bother preparing environment if we can't pass it to libdwfl. */
 #if !HAVE_DWFL_SET_SYSROOT
-        return -EBADF;
+        return -EOPNOTSUPP;
 #endif
 
         if (!arg_access_container)
-                return -EBADF;
+                return -EOPNOTSUPP;
 
         if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, pair) < 0)
                 return log_error_errno(errno, "Failed to create socket pair: %m");
@@ -1761,7 +1761,7 @@ static int process_kernel(int argc, char* argv[]) {
                         return 0;
 
                 r = gather_pid_mount_tree_fd(&context);
-                if (r < 0 && r != -EBADF)
+                if (r < 0 && r != -EOPNOTSUPP)
                         log_warning_errno(r, "Failed to access the mount tree of a container, ignoring: %m");
                 else
                         mount_tree_fd = r;