Play nice with xargs
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 11 Feb 2008 18:45:15 +0000 (20:45 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 11 Feb 2008 18:45:15 +0000 (20:45 +0200)
- xargs considers exit status 255 special, avoid it. The exit status is
  unrealiable anyway so 254 vs 255 shouldn't matter

Patch from Michal Marek

rpmqv.c

diff --git a/rpmqv.c b/rpmqv.c
index 3baa58b..1db5f1e 100644 (file)
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -879,8 +879,8 @@ exit:
     muntrace();   /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
 #endif
 
-    /* XXX don't overflow single byte exit status */
-    if (ec > 255) ec = 255;
+    /* XXX Avoid exit status overflow. Status 255 is special to xargs(1) */
+    if (ec > 254) ec = 254;
 
     return ec;
 }