From: Paul Eggert Date: Wed, 18 Oct 2006 22:33:06 +0000 (+0000) Subject: * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy X-Git-Tag: COREUTILS-6_4~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81afea011033c0389ff03cfd4cc968f0b0cefaf0;p=thirdparty%2Fcoreutils.git * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy a fifo. This preserves the special mode bits on Solaris 10, which is compatible with what Solaris 10 cp -R does. --- diff --git a/ChangeLog b/ChangeLog index 7aabf939f0..86e7d849be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-18 Paul Eggert + * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy + a fifo. This preserves the special mode bits on Solaris 10, which + is compatible with what Solaris 10 cp -R does. + * src/copy.c (copy_internal): Remove redundant and confusing local variable src_type. diff --git a/src/copy.c b/src/copy.c index 5625ca9ce6..d9a727aa91 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1638,7 +1638,7 @@ copy_internal (char const *src_name, char const *dst_name, } else if (S_ISFIFO (src_mode)) { - if (mkfifo (dst_name, src_mode)) + if (mknod (dst_name, src_mode, 0) != 0) { error (0, errno, _("cannot create fifo %s"), quote (dst_name)); goto un_backup; @@ -1646,7 +1646,7 @@ copy_internal (char const *src_name, char const *dst_name, } else if (S_ISBLK (src_mode) || S_ISCHR (src_mode) || S_ISSOCK (src_mode)) { - if (mknod (dst_name, src_mode, src_sb.st_rdev)) + if (mknod (dst_name, src_mode, src_sb.st_rdev) != 0) { error (0, errno, _("cannot create special file %s"), quote (dst_name));