]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: drop unnecessary check 38409/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Jul 2025 16:04:24 +0000 (18:04 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Jul 2025 16:05:54 +0000 (18:05 +0200)
errno_name_no_fallback() (and errno_to_name() before that) already
handle negative errnos properly.

src/libsystemd/sd-bus/bus-error.c

index e5c9eb64a4ee45ba003a60de6c0bc64239cac84d..bc0164c1b4ebb2d60c00b7c9e6f302cfce64f3bd 100644 (file)
@@ -165,9 +165,6 @@ static int errno_to_bus_error_name_new(int error, char **ret) {
         const char *name;
         char *n;
 
-        if (error < 0)
-                error = -error;
-
         /* D-Bus names must not start with a digit. Thus, an name like System.Error.500 would not be legal.
          * Let's just return 0 if an unknown errno is encountered, which will cause the caller to fall back
          * to BUS_ERROR_FAILED.