1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-04 07:43:58 +02:00

* 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.
This commit is contained in:
Paul Eggert
2006-10-18 22:33:06 +00:00
parent 7bc17873e5
commit 81afea0110
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -1,5 +1,9 @@
2006-10-18 Paul Eggert <eggert@cs.ucla.edu>
* 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.
+2 -2
View File
@@ -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));