bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] [GNU tar 1.17] testsuite: 12 40 41 42 failed


From: Eric Blake
Subject: Re: [Bug-tar] [GNU tar 1.17] testsuite: 12 40 41 42 failed
Date: Wed, 20 Jun 2007 20:47:26 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Denis Excoffier on 6/11/2007 5:52 AM:
> Hello,
> 
> I use one of the latests cygwin (1.5.24-2).
> 
> 1) I would prefer if the following test:
> 
> @40 (long01.at:56, long file names divisible by block size)
> 
> were said to be "expected to fail" in my case (cygwin). Indeed, it
> seems that no file name can have more than (about) 224 characters. The
> test uses a filename 512-character long.

Actually, on cygwin, the current limit is PATH_MAX for the corresponding
absolute name of all files (regardless of how short a relative name is),
and is set to 260 due to the limitations of Win9x on FAT file systems
(barely over the POSIX-mandated 256, but rather shy of the XSI minimum
standard of 1024).  A future version of cygwin may be able to expand that
to 32k, which is the NTFS file system limit.

Anyway, here's how I fixed the problem when packaging the cygwin distro of
tar; could we get this patch applied upstream?  With this patch, plus the
fix for test 12, all tests passed or were skipped on cygwin for tar 1.17.
 It relies on gnulib's fcntl.h replacement guaranteeing that O_BINARY is
defined to 0 on platforms where it is not needed.

tar:
2007-06-20  Eric Blake  <address@hidden>

        Resolve testsuite failures 40-42 on cygwin.
        * tests/testsuite.at (AT_TAR_MKHIER): Skip tests when long file
        names cannot be created.

paxutils:
2007-06-20  Eric Blake  <address@hidden>

        Resolve testsuite failures on cygwin.
        * tests/genfile.c (generate_simple_file): Force binary mode.
        (generate_files_from_list, generate_sparse_file)
        (exec_checkpoint, exec_command): Likewise.

> 
> This e-mail is intended only for the above addressee.

Such disclaimers are frowned upon on publicly archived mailing lists, as
they cannot be enforced.  Please consider using a free webmail account
rather than your employer's gateway if you have no control over this trailer.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGeea+84KuGfSFAYARAjdvAKCNyVXHeS8XnDa1ZfGsqMYc/qC7yQCeMdBO
Bt+TnT/ieOHhXMg1ZJsYsNM=
=SA+3
-----END PGP SIGNATURE-----
Index: tests/testsuite.at
===================================================================
RCS file: /sources/tar/tar/tests/testsuite.at,v
retrieving revision 1.34
diff -u -p -r1.34 testsuite.at
--- tests/testsuite.at  23 Jan 2007 10:26:30 -0000      1.34
+++ tests/testsuite.at  21 Jun 2007 02:38:23 -0000
@@ -84,7 +84,7 @@ test $result -eq 0 && AT_SKIP_TEST
 ])
 
 m4_define([AT_TAR_MKHIER],[
-install-sh -d $1 >/dev/null
+install-sh -d $1 >/dev/null || AT_SKIP_TEST
 m4_if([$2],,,genfile --file [$1]/[$2])])
 
 m4_include([sparsemvp.at])
Index: tests/genfile.c
===================================================================
RCS file: /sources/paxutils/paxutils/tests/genfile.c,v
retrieving revision 1.21
diff -u -p -r1.21 genfile.c
--- tests/genfile.c     7 Dec 2006 13:18:49 -0000       1.21
+++ tests/genfile.c     21 Jun 2007 02:40:14 -0000
@@ -1,7 +1,7 @@
 /* Generate a file containing some preset patterns.
    Print statistics for existing files.
 
-   Copyright (C) 1995, 1996, 1997, 2001, 2003, 2004, 2005, 2006
+   Copyright (C) 1995, 1996, 1997, 2001, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    François Pinard <address@hidden>, 1995.
@@ -32,6 +32,8 @@
 #include <setenv.h>
 #include <utimens.h>
 #include <inttostr.h>
+#include <fcntl.h>
+#include <sys/stat.h>
 #define obstack_chunk_alloc malloc
 #define obstack_chunk_free free
 #include <obstack.h>
@@ -344,7 +346,7 @@ parse_opt (int key, char *arg, struct ar
     case OPT_SEEK:
       seek_offset = get_size (arg, 0);
       break;
-      
+
     case OPT_CHECKPOINT:
       {
        char *p;
@@ -415,7 +417,7 @@ generate_simple_file (char *filename)
 
   if (filename)
     {
-      fp = fopen (filename, seek_offset ? "r+" : "w");
+      fp = fopen (filename, seek_offset ? "rb+" : "wb");
       if (!fp)
        error (EXIT_FAILURE, 0, _("cannot open `%s'"), filename);
     }
@@ -424,7 +426,7 @@ generate_simple_file (char *filename)
 
   if (fseeko (fp, seek_offset, 0))
     error (EXIT_FAILURE, 0, _("cannot seek: %s"), strerror (errno));
-  
+
   fill (fp, file_length, pattern);
 
   fclose (fp);
@@ -453,7 +455,7 @@ read_name_from_file (FILE *fp, struct ob
 void
 generate_files_from_list ()
 {
-  FILE *fp = strcmp (files_from, "-") ? fopen (files_from, "r") : stdin;
+  FILE *fp = strcmp (files_from, "-") ? fopen (files_from, "rb") : stdin;
   struct obstack stk;
 
   if (!fp)
@@ -501,14 +503,14 @@ generate_sparse_file (int argc, char **a
 {
   int i;
   int fd;
-  int flags = O_CREAT|O_RDWR;
-  
+  int flags = O_CREAT | O_RDWR | O_BINARY;
+
   if (!file_name)
     error (EXIT_FAILURE, 0,
           _("cannot generate sparse files on standard output, use --file 
option"));
   if (!seek_offset)
     flags |= O_TRUNC;
-  fd = open (file_name, flags, 0644);
+  fd = open (file_name, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
   if (fd < 0)
     error (EXIT_FAILURE, 0, _("cannot open `%s'"), file_name);
 
@@ -657,7 +659,7 @@ exec_checkpoint (struct action *p)
 
     case OPT_APPEND:
       {
-       FILE *fp = fopen (p->name, "a");
+       FILE *fp = fopen (p->name, "ab");
        if (!fp)
          {
            error (0, errno, _("cannot open `%s'"), p->name);
@@ -671,7 +673,7 @@ exec_checkpoint (struct action *p)
 
     case OPT_TRUNCATE:
       {
-       int fd = open (p->name, O_RDWR);
+       int fd = open (p->name, O_RDWR | O_BINARY);
        if (fd == -1)
          {
            error (0, errno, _("cannot open `%s'"), p->name);
@@ -766,7 +768,7 @@ exec_command (void)
 
   /* Master */
   close (fd[1]);
-  fp = fdopen (fd[0], "r");
+  fp = fdopen (fd[0], "rb");
   if (fp == NULL)
     error (EXIT_FAILURE, errno, "fdopen");
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]