]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(copy_file): Allow installation from non-directory (rather than only regular)
authorJim Meyering <jim@meyering.net>
Sat, 30 Nov 1996 04:33:30 +0000 (04:33 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 30 Nov 1996 04:33:30 +0000 (04:33 +0000)
files.  Suggestion from Charles Karney.

src/install.c

index 914cd63130c5fc619631f3fe714f38bf1be48634..c31c1a7c00c15b919e3a1e6e1ebf7e7950ddd23c 100644 (file)
@@ -370,9 +370,13 @@ copy_file (char *from, char *to, int *to_created)
       error (0, errno, "%s", from);
       return 1;
     }
-  if (!S_ISREG (from_stats.st_mode))
+
+  /* Allow installing from non-regular files like /dev/null.
+     Charles Karney reported that some Sun version of install allows that
+     and that sendmail's installation process relies on the behavior.  */
+  if (S_ISDIR (from_stats.st_mode))
     {
-      error (0, 0, _("`%s' is not a regular file"), from);
+      error (0, 0, _("`%s' is a directory"), from);
       return 1;
     }
   if (stat (to, &to_stats) == 0)