]> git.proxmox.com Git - systemd.git/commitdiff
Fix hostnamectl exit code on success
authorMartin Pitt <martin.pitt@ubuntu.com>
Fri, 28 Nov 2014 14:45:13 +0000 (15:45 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Fri, 28 Nov 2014 14:57:45 +0000 (15:57 +0100)
Regression in 217, spotted by our autopkgtest.

debian/changelog
debian/patches/hostnamectl-Exit-with-zero-on-success.patch [new file with mode: 0644]
debian/patches/series

index 147e398c4f3443a585903975b0b8e05a03404cb4..1495b1fdff7ebecb2b5d9091ec34ca25d3df0dea 100644 (file)
@@ -2,6 +2,7 @@ systemd (217-2) UNRELEASED; urgency=medium
 
   * Re-enable journal forwarding to syslog, until Debian's sysloggers
     can/do all read from the journal directly.
+  * Fix hostnamectl exit code on success.
 
  -- Martin Pitt <mpitt@debian.org>  Fri, 28 Nov 2014 14:46:30 +0100
 
diff --git a/debian/patches/hostnamectl-Exit-with-zero-on-success.patch b/debian/patches/hostnamectl-Exit-with-zero-on-success.patch
new file mode 100644 (file)
index 0000000..a331d4c
--- /dev/null
@@ -0,0 +1,22 @@
+From: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Fri, 28 Nov 2014 15:38:05 +0100
+Subject: hostnamectl: Exit with zero on success
+
+In show_all_names(), bus_map_all_properties() returns 1 on success which is
+then used as the return code of show_all_names() and eventually main(). Exit
+with zero in main() on all nonnegative results to guard against similar errors.
+---
+ src/hostname/hostnamectl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
+index e487369..ff4e9c9 100644
+--- a/src/hostname/hostnamectl.c
++++ b/src/hostname/hostnamectl.c
+@@ -536,5 +536,5 @@ int main(int argc, char *argv[]) {
+         r = hostnamectl_main(bus, argc, argv);
+ finish:
+-        return r < 0 ? EXIT_FAILURE : r;
++        return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+ }
index 8d18457b68534e28cebe5847b8f7a9594d3f5649..8fa1fc097de9410703d68905fcec78c0c5183a9f 100644 (file)
@@ -55,3 +55,4 @@ Add-env-variable-for-machine-ID-path.patch
 sysv-generator-Avoid-wrong-dependencies-for-failing-.patch
 Prefer-etc-X11-default-display-manager-if-present.patch
 Re-enable-journal-forwarding-to-syslog.patch
+hostnamectl-Exit-with-zero-on-success.patch