copy.c: remove an in-function #ifdef
authorJim Meyering <meyering@redhat.com>
Wed, 2 Apr 2008 11:52:04 +0000 (13:52 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 2 Apr 2008 16:22:59 +0000 (18:22 +0200)
* src/copy.c (rpl_mkfifo) [! HAVE_MKFIFO]: New function.
(mkfifo) [! HAVE_MKFIFO]: Define to rpl_mkfifo.
(copy_internal): Remove #ifdef.

Signed-off-by: Jim Meyering <meyering@redhat.com>
src/copy.c

index 208a674..4e38e00 100644 (file)
 # define lchown(name, uid, gid) chown (name, uid, gid)
 #endif
 
+#ifndef HAVE_MKFIFO
+static int
+rpl_mkfifo (char const *file, mode_t mode)
+{
+  errno = ENOTSUP;
+  return -1;
+}
+#define mkfifo rpl_mkfifo
+#endif
+
 #ifndef USE_ACL
 # define USE_ACL 0
 #endif
@@ -1828,9 +1838,7 @@ copy_internal (char const *src_name, char const *dst_name,
         does not.  But fall back on mkfifo, because on some BSD systems,
         mknod always fails when asked to create a FIFO.  */
       if (mknod (dst_name, src_mode & ~omitted_permissions, 0) != 0)
-#if HAVE_MKFIFO
        if (mkfifo (dst_name, src_mode & ~S_IFIFO & ~omitted_permissions) != 0)
-#endif
          {
            error (0, errno, _("cannot create fifo %s"), quote (dst_name));
            goto un_backup;