[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] Re: test mode [PATCH]
From: |
Gerry Reno |
Subject: |
[Bug-tar] Re: test mode [PATCH] |
Date: |
Sun, 28 Sep 2003 07:59:42 -0700 (PDT) |
--- Gerry Reno <address@hidden> wrote:
> Ok, using -f /dev/null would work for this with unices but not for
> msdos. The msdos version works with the following patch:
>
Found a problem with the first patch making 0 length archive.
-------------------------------------------------------------
This patch tests ok:
$diff -u buffer.c.prepatch buffer.c
--- buffer.c.prepatch 2003-09-10 18:50:26.218750000 -0400
+++ buffer.c 2003-09-28 10:49:21.156250000 -0400
@@ -74,11 +74,9 @@
static void archive_write_error (ssize_t) __attribute__ ((noreturn));
static void archive_read_error (void);
-#if !MSDOS
/* Obnoxious test to see if dimwit is trying to dump the archive. */
dev_t ar_dev;
ino_t ar_ino;
-#endif
/* PID of child program, if compress_option or remote archive access.
*/
static pid_t child_pid;
@@ -799,11 +797,18 @@
open_fatal (archive_name_array[0]);
}
-#if !MSDOS
- /* Detect if outputting to "/dev/null". */
{
+#if !MSDOS
+ /* Detect if outputting to "/dev/null". */
static char const dev_null[] = "/dev/null";
+
+#else
+ /* DOS/Windows: Detect if outputting to "nul". */
+ static char const dev_null[] = "nul";
+
+#endif /* not MSDOS */
+
struct stat dev_null_stat;
dev_null_output =
@@ -823,7 +828,6 @@
else
ar_dev = 0;
-#endif /* not MSDOS */
#if MSDOS
setmode (archive, O_BINARY);
-------------------------------------------------------------
=====
Gerry Reno
mailto: grenoml at@ yahoo dot. com
(if mail bounces please retry later - spam rapidly fills up mailbox)
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com