mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
Needed on MacOS X. Signed-off-by: Jim Meyering <jim@meyering.net>
This commit is contained in:
1 parent
f0b5e513d9
commit
8563b4c051
2 files changed
+14
-5
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2007-01-03 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
|
||||
Needed on MacOS X.
|
||||
|
||||
2007-01-02 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Now, "ls -FRL" always follows symbolic links on Linux.
|
||||
|
||||
+9
-5
@@ -1686,12 +1686,16 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
{
|
||||
/* Use mknod, rather than mkfifo, because the former preserves
|
||||
the special mode bits of a fifo on Solaris 10, while mkfifo
|
||||
does not. */
|
||||
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)
|
||||
{
|
||||
error (0, errno, _("cannot create fifo %s"), quote (dst_name));
|
||||
goto un_backup;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
}
|
||||
else if (S_ISBLK (src_mode) || S_ISCHR (src_mode) || S_ISSOCK (src_mode))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user