coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 8/9] cp: -Z: fix a logic error due to incorrect braces in mkfifo


From: Pádraig Brady
Subject: [PATCH 8/9] cp: -Z: fix a logic error due to incorrect braces in mkfifo
Date: Wed, 28 Nov 2012 01:43:18 +0000

src/mkfifo.c (main): Call mkfifo() for all args rather than the last.
---
 src/mkfifo.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/mkfifo.c b/src/mkfifo.c
index 9e80a20..a392459 100644
--- a/src/mkfifo.c
+++ b/src/mkfifo.c
@@ -137,13 +137,15 @@ main (int argc, char **argv)
     }
 
   for (; optind < argc; ++optind)
-    if (set_security_context)
-      defaultcon (argv[optind], S_IFIFO);
-    if (mkfifo (argv[optind], newmode) != 0)
-      {
-        error (0, errno, _("cannot create fifo %s"), quote (argv[optind]));
-        exit_status = EXIT_FAILURE;
-      }
+    {
+      if (set_security_context)
+        defaultcon (argv[optind], S_IFIFO);
+      if (mkfifo (argv[optind], newmode) != 0)
+        {
+          error (0, errno, _("cannot create fifo %s"), quote (argv[optind]));
+          exit_status = EXIT_FAILURE;
+        }
+    }
 
   exit (exit_status);
 }
-- 
1.7.6.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]