--- src/copy.c +++ src/copy.c @@ -1050,11 +1050,18 @@ copy_reg (char const *src_name, char con saved ones obtained via a previous call to stat. */ if (! SAME_INODE (*src_sb, src_open_sb)) { - error (0, 0, - _("skipping file %s, as it was replaced while being copied"), - quoteaf (src_name)); - return_val = false; - goto close_src_desc; + /* Stat and fstat returns different results on Solaris for devices + like /dev/stdin. Confirm that this is not the case. */ + mode_t file_type = src_open_sb.st_mode & S_IFMT; + if (!(file_type == S_IFBLK || file_type == S_IFCHR || + file_type == S_IFIFO || file_type == S_IFSOCK)) + { + error (0, 0, + _("skipping file %s, as it was replaced while being copied"), + quoteaf (src_name)); + return_val = false; + goto close_src_desc; + } } /* The semantics of the following open calls are mandated