summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-10-18 22:33:06 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-10-18 22:33:06 +0000
commit81afea011033c0389ff03cfd4cc968f0b0cefaf0 (patch)
tree1c88f29da1fbe5196cf2e0bb55e52def7f5de80c /src
parent7bc17873e5e304ea50842aa1908caeb24685e949 (diff)
downloadcoreutils-81afea011033c0389ff03cfd4cc968f0b0cefaf0.tar.xz
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index 5625ca9ce..d9a727aa9 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));