summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2001-09-23 05:03:42 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2001-09-23 05:03:42 +0000
commit9a15fcf4913ecca267fe2bdd8f24a3f67594a3e3 (patch)
treed2239b21ea1f5c72104df39e96ba72062dfe10e1
parente2b5f1e918f086e35cbc0b57cedcd40279e8b6e4 (diff)
downloadtar-9a15fcf4913ecca267fe2bdd8f24a3f67594a3e3.tar.gz
(write_archive_buffer, close_archive): If an archive is a socket,
treat it like a FIFO.
-rw-r--r--src/buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d29cccce..949505c0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -301,7 +301,9 @@ write_archive_buffer (void)
{
written += status;
if (written == record_size
- || _isrmt (archive) || ! S_ISFIFO (archive_stat.st_mode))
+ || _isrmt (archive)
+ || ! (S_ISFIFO (archive_stat.st_mode)
+ || S_ISSOCK (archive_stat.st_mode)))
break;
}
@@ -1335,7 +1337,7 @@ close_archive (void)
if (access_mode == ACCESS_READ
&& ! _isrmt (archive)
- && S_ISFIFO (archive_stat.st_mode))
+ && (S_ISFIFO (archive_stat.st_mode) || S_ISSOCK (archive_stat.st_mode)))
while (rmtread (archive, record_start->buffer, record_size) > 0)
continue;
#endif