From: jtc@gain.COM (J.T. Conklin)
Subject: tar-1.11 and HPUX 8.07 & IRIX 4.0.1
Reply-To: jtc@gain.com
Organization: Gnus Not Usenet
Distribution: gnu
Date: Fri, 11 Sep 1992 08:41:05 GMT

Fixed in patch:
HPUX:
   doesn't handle files where '#' of a preprocessor directive is
   not the first character of a line.

IRIX:
   Compiler is not ansi but understands prototypes and const.  The
   ``#define const'' in several files confuses things.  Use
   autoconf's AC_CONST instead.

   utime() is prototyped in unistd.h, and the old way of using
   an array of longs conflicts with the prototypes.  Using fileutils
   as a guide, I converted the code to use struct utimbuf.

   The declarations of getgrgid() and getpwuid() in names.c conflict
   with the prototypes in <grp.h> and <pwd.h>.  This is because
   uid_t and gid_t are unsigned short and the normal promotion rules
   implied by the declarations conflict with the prototypes.  I added
   autoconf rules to check if these functions are declared.


Not fixed in patch:
HPUX:
   linking with -lPW for alloca causes link error with unresolved
   external ``Error''.  Using alloca.c works.  Perhaps autoconf should
   see if linking with -lPW will actually work???

IRIX:
   As has been mentioned in other reports, valloc is found in both
   port.c and malloc.c.

diff -c tar/buffer.c:1.1.1.1 tar/buffer.c:1.2
*** tar/buffer.c:1.1.1.1	Fri Sep 11 15:34:52 1992
--- tar/buffer.c	Fri Sep 11 15:34:52 1992
***************
*** 1337,1345 ****
  			    break;

  		    case '!':
!     #ifdef __MSDOS__
  			    spawnl(P_WAIT,getenv("COMSPEC"),"-",0);
!     #else
  				    /* JF this needs work! */
  			    switch(fork()) {
  			    case -1:
--- 1337,1345 ----
  			    break;

  		    case '!':
! #ifdef __MSDOS__
  			    spawnl(P_WAIT,getenv("COMSPEC"),"-",0);
! #else
  				    /* JF this needs work! */
  			    switch(fork()) {
  			    case -1:
***************
*** 1355,1361 ****
  				    wait(0);
  				    break;
  			    }
!     #endif
  			    break;
  		  }
  		  }
--- 1355,1361 ----
  				    wait(0);
  				    break;
  			    }
! #endif
  			    break;
  		  }
  		  }
diff -c tar/configure:1.1.1.1 tar/configure:1.3
*** tar/configure:1.1.1.1	Fri Sep 11 15:34:53 1992
--- tar/configure	Fri Sep 11 15:34:53 1992
***************
*** 488,493 ****
--- 488,509 ----
  fi
  rm -f conftest*

+ echo checking for getgrgid declaration
+ echo '#include <grp.h>' > conftest.c
+ eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
+ if egrep "getgrgid" conftest.out >/dev/null 2>&1; then
+   DEFS="$DEFS -DHAVE_GETGRGID=1"
+ fi
+ rm -f conftest*
+
+ echo checking for getpwuid declaration
+ echo '#include <pwd.h>' > conftest.c
+ eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
+ if egrep "getpwuid" conftest.out >/dev/null 2>&1; then
+   DEFS="$DEFS -DHAVE_GETPWUID=1"
+ fi
+ rm -f conftest*
+
  echo checking for BSD string and memory functions
  echo "#include <strings.h>
  main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
***************
*** 612,617 ****
--- 628,645 ----
  test -f /vmunix && DEFS="$DEFS -DBSD42=1"
  echo checking for HP-UX
  test -f /hp-ux && test -f /vmunix || MALLOC=malloc.o
+
+ echo checking for working const
+ echo "
+ main() { exit(0); } t() { /* Ultrix mips cc rejects this.  */
+ typedef int charset[2]; const charset x;
+  }" > conftest.c
+ if eval $compile; then
+   :
+ else
+   DEFS="$DEFS -Dconst="
+ fi
+ rm -f conftest*

  echo checking for Xenix
  cat <<EOF > conftest.c
diff -c tar/configure.in:1.1.1.1 tar/configure.in:1.3
*** tar/configure.in:1.1.1.1	Fri Sep 11 15:34:53 1992
--- tar/configure.in	Fri Sep 11 15:34:53 1992
***************
*** 24,29 ****
--- 24,33 ----
  AC_STDC_HEADERS
  AC_UNISTD_H
  AC_HEADER_CHECK(limits.h, AC_DEFINE(HAVE_LIMITS_H))
+ echo checking for getgrgid declaration
+ AC_HEADER_EGREP(getgrgid, grp.h, AC_DEFINE(HAVE_GETGRGID))
+ echo checking for getpwuid declaration
+ AC_HEADER_EGREP(getpwuid, pwd.h, AC_DEFINE(HAVE_GETPWUID))
  AC_USG
  echo checking default archive
  # This is likely to guess wrong, but it's not very important.
***************
*** 47,51 ****
--- 51,56 ----
  echo checking for HP-UX
  test -f /hp-ux && test -f /vmunix || MALLOC=malloc.o
  AC_SUBST(MALLOC)
+ AC_CONST
  AC_XENIX_DIR
  AC_OUTPUT(Makefile)
diff -c tar/create.c:1.1.1.1 tar/create.c:1.2
*** tar/create.c:1.1.1.1	Fri Sep 11 15:34:54 1992
--- tar/create.c	Fri Sep 11 15:34:54 1992
***************
*** 49,54 ****
--- 49,64 ----
  #include <grp.h>
  #endif

+ #ifdef _POSIX_VERSION
+ #include <utime.h>
+ #else /* not _POSIX_VERSION */
+ struct utimbuf
+ {
+   long actime;
+   long modtime;
+ };
+ #endif /* _POSIX_VERSION */
+
  #if defined(_POSIX_VERSION) || defined(DIRENT)
  #include <dirent.h>
  #ifdef direct
***************
*** 206,212 ****
  	char save_linkflag;
  	extern time_t new_time;
  	int critical_error = 0;
! 	time_t restore_times[2];
  /*	int sparse_ind = 0;*/


--- 216,222 ----
  	char save_linkflag;
  	extern time_t new_time;
  	int critical_error = 0;
! 	struct utimbuf restore_times;
  /*	int sparse_ind = 0;*/


***************
*** 234,241 ****
  		return;
  	}

! 	restore_times[0] = hstat.st_atime;
! 	restore_times[1] = hstat.st_mtime;

  #ifdef S_ISHIDDEN
  	if (S_ISHIDDEN (hstat.st_mode)) {
--- 244,251 ----
  		return;
  	}

! 	restore_times.actime  = hstat.st_atime;
! 	restore_times.modtime = hstat.st_mtime;

  #ifdef S_ISHIDDEN
  	if (S_ISHIDDEN (hstat.st_mode)) {
***************
*** 574,580 ****
  		      msg_perror ("cannot remove %s", p);
  		  }
  		if (f_atime_preserve)
! 		  utime (p, restore_times);
  		return;

  		/*
--- 584,590 ----
  		      msg_perror ("cannot remove %s", p);
  		  }
  		if (f_atime_preserve)
! 		  utime (p, &restore_times);
  		return;

  		/*
***************
*** 594,600 ****
  		if(f>=0)
  			(void)close(f);
  		if (f_atime_preserve)
! 		  utime (p, restore_times);
  	        return;
  	}

--- 604,610 ----
  		if(f>=0)
  			(void)close(f);
  		if (f_atime_preserve)
! 		  utime (p, &restore_times);
  	        return;
  	}

***************
*** 727,733 ****
  			if(f_multivol)
  				save_name = 0;
  			if (f_atime_preserve)
! 			  utime (p, restore_times);
   			return;
  		}

--- 737,743 ----
  			if(f_multivol)
  				save_name = 0;
  			if (f_atime_preserve)
! 			  utime (p, &restore_times);
   			return;
  		}

***************
*** 786,792 ****
  		closedir(dirp);
  		free(namebuf);
  		if (f_atime_preserve)
! 		  utime (p, restore_times);
  		return;
  	}

--- 796,802 ----
  		closedir(dirp);
  		free(namebuf);
  		if (f_atime_preserve)
! 		  utime (p, &restore_times);
  		return;
  	}

diff -c tar/extract.c:1.1.1.1 tar/extract.c:1.3
*** tar/extract.c:1.1.1.1	Fri Sep 11 15:34:55 1992
--- tar/extract.c	Fri Sep 11 15:34:55 1992
***************
*** 53,61 ****
  #include "tar.h"
  #include "port.h"

! #if defined(_POSIX_VERSION)
  #include <utime.h>
! #endif

  extern FILE *msg_file;

--- 53,67 ----
  #include "tar.h"
  #include "port.h"

! #ifdef _POSIX_VERSION
  #include <utime.h>
! #else /* not _POSIX_VERSION */
! struct utimbuf
! {
!   long actime;
!   long modtime;
! };
! #endif /* _POSIX_VERSION */

  extern FILE *msg_file;

***************
*** 102,108 ****
    int mtime;
    struct saved_dir_info *next;
  };
!
  struct saved_dir_info *saved_dir_info_head;

  /*
--- 108,114 ----
    int mtime;
    struct saved_dir_info *next;
  };
!
  struct saved_dir_info *saved_dir_info_head;

  /*
***************
*** 138,153 ****
  	register char *data;
  	int fd, check, namelen, written, openflag;
  	long size;
! 	time_t acc_upd_times[2];
  	register int skipcrud;
  	register int i;
  /*	int sparse_ind = 0;*/
! 	union record *exhdr;
  	struct saved_dir_info *tmp;
  /*	int end_nulls; */
  	char **longp;
  	char *bp;
!
  	saverec(&head);			/* Make sure it sticks around */
  	userec(head);			/* And go past it in the archive */
  	decode_header(head, &hstat, &head_standard, 1);	/* Snarf fields */
--- 144,159 ----
  	register char *data;
  	int fd, check, namelen, written, openflag;
  	long size;
! 	struct utimbuf acc_upd_times;
  	register int skipcrud;
  	register int i;
  /*	int sparse_ind = 0;*/
! 	union record *exhdr;
  	struct saved_dir_info *tmp;
  /*	int end_nulls; */
  	char **longp;
  	char *bp;
!
  	saverec(&head);			/* Make sure it sticks around */
  	userec(head);			/* And go past it in the archive */
  	decode_header(head, &hstat, &head_standard, 1);	/* Snarf fields */
***************
*** 190,196 ****
  			 head->header.linkflag, skipcrud+current_file_name);
  		 /* FALL THRU */

! 	 /*
  	  * JK - What we want to do if the file is sparse is loop through
  	  * the array of sparse structures in the header and read in
  	  * and translate the character strings representing  1) the offset
--- 196,202 ----
  			 head->header.linkflag, skipcrud+current_file_name);
  		 /* FALL THRU */

! 	 /*
  	  * JK - What we want to do if the file is sparse is loop through
  	  * the array of sparse structures in the header and read in
  	  * and translate the character strings representing  1) the offset
***************
*** 200,206 ****
  	  * the tar file that had to deal with a sparse file.
  	  *
  	  * After we read in the first five (at most) sparse structures,
! 	  * we check to see if the file has an extended header, i.e.,
  	  * if more sparse structures are needed to describe the contents
  	  * of the new file.  If so, we read in the extended headers
  	  * and continue to store their contents into the sparsearray.
--- 206,212 ----
  	  * the tar file that had to deal with a sparse file.
  	  *
  	  * After we read in the first five (at most) sparse structures,
! 	  * we check to see if the file has an extended header, i.e.,
  	  * if more sparse structures are needed to describe the contents
  	  * of the new file.  If so, we read in the extended headers
  	  * and continue to store their contents into the sparsearray.
***************
*** 209,217 ****
  		 sp_array_size = 10;
  		 sparsearray = (struct sp_array *) malloc(sp_array_size * sizeof(struct sp_array));
  		 for (i = 0; i < SPARSE_IN_HDR; i++) {
! 			 sparsearray[i].offset =
  				 from_oct(1+12, head->header.sp[i].offset);
! 			 sparsearray[i].numbytes =
  				 from_oct(1+12, head->header.sp[i].numbytes);
  			 if (!sparsearray[i].numbytes)
  				 break;
--- 215,223 ----
  		 sp_array_size = 10;
  		 sparsearray = (struct sp_array *) malloc(sp_array_size * sizeof(struct sp_array));
  		 for (i = 0; i < SPARSE_IN_HDR; i++) {
! 			 sparsearray[i].offset =
  				 from_oct(1+12, head->header.sp[i].offset);
! 			 sparsearray[i].numbytes =
  				 from_oct(1+12, head->header.sp[i].numbytes);
  			 if (!sparsearray[i].numbytes)
  				 break;
***************
*** 221,227 ****

  		 if (head->header.isextended) {
  			 /* read in the list of extended headers
! 			    and translate them into the sparsearray
  			    as before */

  			 /* static */ int ind = SPARSE_IN_HDR;
--- 227,233 ----

  		 if (head->header.isextended) {
  			 /* read in the list of extended headers
! 			    and translate them into the sparsearray
  			    as before */

  			 /* static */ int ind = SPARSE_IN_HDR;
***************
*** 236,242 ****
  					  * realloc the scratch area
  					  * since we've run out of room --
  					  */
! 						 sparsearray = (struct sp_array *)
  								 realloc(sparsearray,
  								 2 * sp_array_size * (sizeof(struct sp_array)));
  						 sp_array_size *= 2;
--- 242,248 ----
  					  * realloc the scratch area
  					  * since we've run out of room --
  					  */
! 						 sparsearray = (struct sp_array *)
  								 realloc(sparsearray,
  								 2 * sp_array_size * (sizeof(struct sp_array)));
  						 sp_array_size *= 2;
***************
*** 243,254 ****
  					 }
  					 if (!exhdr->ext_hdr.sp[i].numbytes)
  						 break;
! 					 sparsearray[i+ind].offset =
  						 from_oct(1+12, exhdr->ext_hdr.sp[i].offset);
! 					 sparsearray[i+ind].numbytes =
  						 from_oct(1+12, exhdr->ext_hdr.sp[i].numbytes);
  				 }
! 				 if (!exhdr->ext_hdr.isextended)
  					 break;
  				 else {
  					 ind += SPARSE_EXT_HDR;
--- 249,260 ----
  					 }
  					 if (!exhdr->ext_hdr.sp[i].numbytes)
  						 break;
! 					 sparsearray[i+ind].offset =
  						 from_oct(1+12, exhdr->ext_hdr.sp[i].offset);
! 					 sparsearray[i+ind].numbytes =
  						 from_oct(1+12, exhdr->ext_hdr.sp[i].numbytes);
  				 }
! 				 if (!exhdr->ext_hdr.isextended)
  					 break;
  				 else {
  					 ind += SPARSE_EXT_HDR;
***************
*** 275,281 ****
  		 openflag = (f_keep?
  			 O_BINARY|O_NDELAY|O_WRONLY|O_CREAT|O_EXCL:
  			 O_BINARY|O_NDELAY|O_WRONLY|O_CREAT|O_TRUNC)
! 			 | ((head->header.linkflag == LF_SPARSE) ? 0 : O_APPEND);
  			 /*
  			  * JK - The last | is a kludge to solve the problem
  			  * the O_APPEND flag  causes with files we are
--- 281,287 ----
  		 openflag = (f_keep?
  			 O_BINARY|O_NDELAY|O_WRONLY|O_CREAT|O_EXCL:
  			 O_BINARY|O_NDELAY|O_WRONLY|O_CREAT|O_TRUNC)
! 			 | ((head->header.linkflag == LF_SPARSE) ? 0 : O_APPEND);
  			 /*
  			  * JK - The last | is a kludge to solve the problem
  			  * the O_APPEND flag  causes with files we are
***************
*** 293,299 ****
  			 fd = 1;
  			 goto extract_file;
  		 }
!  #ifdef O_CTG
  		 /*
  		  * Contiguous files (on the Masscomp) have to specify
  		  * the size in the open call that creates them.
--- 299,305 ----
  			 fd = 1;
  			 goto extract_file;
  		 }
! #ifdef O_CTG
  		 /*
  		  * Contiguous files (on the Masscomp) have to specify
  		  * the size in the open call that creates them.
***************
*** 304,312 ****
  				   openflag | O_CTG,
  				   hstat.st_mode, hstat.st_size);
  		 else
!  #endif
  		 {
!  #ifdef NO_OPEN3
  			 /*
  			  * On raw V7 we won't let them specify -k (f_keep), but
  			  * we just bull ahead and create the files.
--- 310,318 ----
  				   openflag | O_CTG,
  				   hstat.st_mode, hstat.st_size);
  		 else
! #endif
  		 {
! #ifdef NO_OPEN3
  			 /*
  			  * On raw V7 we won't let them specify -k (f_keep), but
  			  * we just bull ahead and create the files.
***************
*** 313,327 ****
  			  */
  			 fd = creat((longname
  				     ? longname
! 				     : head->header.name) + skipcrud,
  				    hstat.st_mode);
!  #else
  			 /*
  			  * With 3-arg open(), we can do this up right.
  			  */
  			 fd = open(skipcrud + current_file_name,
  				   openflag, hstat.st_mode);
!  #endif
  		 }

  		 if (fd < 0) {
--- 319,333 ----
  			  */
  			 fd = creat((longname
  				     ? longname
! 				     : head->header.name) + skipcrud,
  				    hstat.st_mode);
! #else
  			 /*
  			  * With 3-arg open(), we can do this up right.
  			  */
  			 fd = open(skipcrud + current_file_name,
  				   openflag, hstat.st_mode);
! #endif
  		 }

  		 if (fd < 0) {
***************
*** 353,360 ****
  			 bcopy(skipcrud+current_file_name, name, namelen);
  			 size = hstat.st_size;
  			 extract_sparse_file(fd, &size, hstat.st_size, name);
! 		 }
! 		 else
  		   for (size = hstat.st_size;
  			size > 0;
  			size -= written) {
--- 359,366 ----
  			 bcopy(skipcrud+current_file_name, name, namelen);
  			 size = hstat.st_size;
  			 extract_sparse_file(fd, &size, hstat.st_size, name);
! 		 }
! 		 else
  		   for (size = hstat.st_size;
  			size > 0;
  			size -= written) {
***************
*** 474,480 ****

  		 /*
  		  * Set the modified time of the file.
! 		  *
  		  * Note that we set the accessed time to "now", which
  		  * is really "the time we started extracting files".
  		  * unless f_gnudump is used, in which case .st_atime is used
--- 480,486 ----

  		 /*
  		  * Set the modified time of the file.
! 		  *
  		  * Note that we set the accessed time to "now", which
  		  * is really "the time we started extracting files".
  		  * unless f_gnudump is used, in which case .st_atime is used
***************
*** 481,492 ****
  		  */
  		 if (!f_modified) {
  			 /* fixme if f_gnudump should set ctime too, but how? */
! 			if(f_gnudump)
! 				acc_upd_times[0]=hstat.st_atime;
! 			else acc_upd_times[0] = now;	         /* Accessed now */
! 			acc_upd_times[1] = hstat.st_mtime; /* Mod'd */
  			if (utime(skipcrud + current_file_name,
! 				  acc_upd_times) < 0) {
  			  msg_perror("couldn't change access and modification times of %s",skipcrud + current_file_name);
  			}
  		}
--- 487,501 ----
  		  */
  		 if (!f_modified) {
  			 /* fixme if f_gnudump should set ctime too, but how? */
! 			if (f_gnudump) {
! 				acc_upd_times.actime = hstat.st_atime;
! 		        } else {
! 				acc_upd_times.actime = now; /* Accessed now */
! 			}
! 			acc_upd_times.modtime = hstat.st_mtime;	/* Mod'd */
!
  			if (utime(skipcrud + current_file_name,
! 				  &acc_upd_times) < 0) {
  			  msg_perror("couldn't change access and modification times of %s",skipcrud + current_file_name);
  			}
  		}
***************
*** 610,620 ****
  		if(f_gnudump) {		/* Read the entry and delete files
  					   that aren't listed in the archive */
  			gnu_restore(skipcrud);
!
  		} else if(head->header.linkflag==LF_DUMPDIR)
  			skip_file((long)(hstat.st_size));

!
  	again_dir:
  		check = mkdir(skipcrud+current_file_name,
  			      (we_are_root ? 0 : 0300) | (int)hstat.st_mode);
--- 619,629 ----
  		if(f_gnudump) {		/* Read the entry and delete files
  					   that aren't listed in the archive */
  			gnu_restore(skipcrud);
!
  		} else if(head->header.linkflag==LF_DUMPDIR)
  			skip_file((long)(hstat.st_size));

!
  	again_dir:
  		check = mkdir(skipcrud+current_file_name,
  			      (we_are_root ? 0 : 0300) | (int)hstat.st_mode);
***************
*** 624,630 ****
  			if (make_dirs(skipcrud+current_file_name))
  				goto again_dir;
  			/* If we're trying to create '.', let it be. */
! 			if (current_file_name[skipcrud+namelen] == '.' &&
  			    (namelen==0 ||
  			     current_file_name[skipcrud+namelen-1]=='/'))
  				goto check_perms;
--- 633,639 ----
  			if (make_dirs(skipcrud+current_file_name))
  				goto again_dir;
  			/* If we're trying to create '.', let it be. */
! 			if (current_file_name[skipcrud+namelen] == '.' &&
  			    (namelen==0 ||
  			     current_file_name[skipcrud+namelen-1]=='/'))
  				goto check_perms;
***************
*** 635,641 ****
  			msg_perror("Could not create directory %s",skipcrud+current_file_name);
  			break;
  		}
!
  	check_perms:
  		if (!we_are_root && 0300 != (0300 & (int) hstat.st_mode)) {
  			hstat.st_mode |= 0300;
--- 644,650 ----
  			msg_perror("Could not create directory %s",skipcrud+current_file_name);
  			break;
  		}
!
  	check_perms:
  		if (!we_are_root && 0300 != (0300 & (int) hstat.st_mode)) {
  			hstat.st_mode |= 0300;
***************
*** 673,680 ****
  		 msg ("Visible long name error\n");
  		 skip_file ((long)hstat.st_size);
  		 break;
! 	}
!
  	/* We don't need to save it any longer. */
  	saverec((union record **) 0);	/* Unsave it */
  }
--- 682,689 ----
  		 msg ("Visible long name error\n");
  		 skip_file ((long)hstat.st_size);
  		 break;
! 	}
!
  	/* We don't need to save it any longer. */
  	saverec((union record **) 0);	/* Unsave it */
  }
***************
*** 737,749 ****
  	long	*sizeleft,
  		totalsize;
  	char	*name;
! {
  /*	register char	*data;*/
  	union record	*datarec;
  	int	sparse_ind = 0;
  	int	written,
  		count;
!
  	/* assuming sizeleft is initially totalsize */


--- 746,758 ----
  	long	*sizeleft,
  		totalsize;
  	char	*name;
! {
  /*	register char	*data;*/
  	union record	*datarec;
  	int	sparse_ind = 0;
  	int	written,
  		count;
!
  	/* assuming sizeleft is initially totalsize */


***************
*** 757,763 ****
  		written = sparsearray[sparse_ind++].numbytes;
  		while (written > RECORDSIZE) {
  			count = write(fd, datarec->charptr, RECORDSIZE);
! 			if (count < 0)
  				msg_perror("couldn't write to file %s", name);
  			written -= count;
  			*sizeleft -= count;
--- 766,772 ----
  		written = sparsearray[sparse_ind++].numbytes;
  		while (written > RECORDSIZE) {
  			count = write(fd, datarec->charptr, RECORDSIZE);
! 			if (count < 0)
  				msg_perror("couldn't write to file %s", name);
  			written -= count;
  			*sizeleft -= count;
***************
*** 766,772 ****
  		}

  		count = write(fd, datarec->charptr, written);
!
  		if (count < 0) {
  			msg_perror("couldn't write to file %s", name);
  		} else if (count != written) {
--- 775,781 ----
  		}

  		count = write(fd, datarec->charptr, written);
!
  		if (count < 0) {
  			msg_perror("couldn't write to file %s", name);
  		} else if (count != written) {
***************
*** 775,781 ****
  		}

  		written -= count;
! 		*sizeleft -= count;
  		userec(datarec);
  	}
  	free(sparsearray);
--- 784,790 ----
  		}

  		written -= count;
! 		*sizeleft -= count;
  		userec(datarec);
  	}
  	free(sparsearray);
***************
*** 792,808 ****
  /* Set back the utime and mode for all the extracted directories. */
  void restore_saved_dir_info ()
  {
!   time_t acc_upd_times[2];
    struct saved_dir_info *tmp;

    while (saved_dir_info_head != NULL)
      {
        /* fixme if f_gnudump should set ctime too, but how? */
!       if(f_gnudump)
! 	acc_upd_times[0]=saved_dir_info_head -> atime;
!       else acc_upd_times[0] = now; /* Accessed now */
!       acc_upd_times[1] = saved_dir_info_head -> mtime; /* Mod'd */
!       if (utime(saved_dir_info_head -> path, acc_upd_times) < 0) {
  	msg_perror("couldn't change access and modification times of %s",
  		   saved_dir_info_head -> path);
        }
--- 801,820 ----
  /* Set back the utime and mode for all the extracted directories. */
  void restore_saved_dir_info ()
  {
!   struct utimbuf acc_upd_times;
    struct saved_dir_info *tmp;

    while (saved_dir_info_head != NULL)
      {
        /* fixme if f_gnudump should set ctime too, but how? */
!       if(f_gnudump) {
! 	acc_upd_times.actime = saved_dir_info_head -> atime;
!       } else {
!         acc_upd_times.actime = now; /* Accessed now */
!       }
!       acc_upd_times.modtime = saved_dir_info_head -> mtime; /* Mod'd */
!
!       if (utime(saved_dir_info_head -> path, &acc_upd_times) < 0) {
  	msg_perror("couldn't change access and modification times of %s",
  		   saved_dir_info_head -> path);
        }
diff -c tar/getopt.c:1.1.1.1 tar/getopt.c:1.2
*** tar/getopt.c:1.1.1.1	Fri Sep 11 15:34:56 1992
--- tar/getopt.c	Fri Sep 11 15:34:57 1992
***************
*** 51,60 ****
  #define	__alloca	alloca
  #endif	/* GNU C library.  */

- #if !__STDC__
- #define const
- #endif
-
  /* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
     long-named option.  Because this is not POSIX.2 compliant, it is
     being phased out.  */
--- 51,56 ----
diff -c tar/getopt1.c:1.1.1.1 tar/getopt1.c:1.2
*** tar/getopt1.c:1.1.1.1	Fri Sep 11 15:34:57 1992
--- tar/getopt1.c	Fri Sep 11 15:34:57 1992
***************
*** 17,26 ****
  
  #include "getopt.h"

- #ifndef __STDC__
- #define const
- #endif
-
  #if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) || defined (LIBC)
  #include <stdlib.h>
  #else /* STDC_HEADERS or __GNU_LIBRARY__ */
--- 17,22 ----
diff -c tar/names.c:1.1.1.1 tar/names.c:1.2
*** tar/names.c:1.1.1.1	Fri Sep 11 15:34:58 1992
--- tar/names.c	Fri Sep 11 15:34:58 1992
***************
*** 58,64 ****
--- 58,66 ----
  	int	uid;
  {
  	struct passwd	*pw;
+ #ifndef HAVE_GETPWUID
  	extern struct passwd *getpwuid ();
+ #endif

  	if (uid != saveuid) {
  		saveuid = uid;
***************
*** 97,103 ****
--- 99,107 ----
  	int	gid;
  {
  	struct group	*gr;
+ #ifndef HAVE_GETGRGID
  	extern struct group *getgrgid ();
+ #endif

  	if (gid != savegid) {
  		savegid = gid;
diff -c tar/port.h:1.2 tar/port.h:1.3
*** tar/port.h:1.2	Fri Sep 11 15:34:58 1992
--- tar/port.h	Fri Sep 11 15:34:59 1992
***************
*** 68,74 ****
  #define PTR void *
  #else
  #define PTR char *
- #define const
  #endif

  /* Since major is a function on SVR4, we can't just use `ifndef major'.  */
--- 68,73 ----
diff -c tar/regex.h:1.1.1.1 tar/regex.h:1.3
*** tar/regex.h:1.1.1.1	Fri Sep 11 15:34:59 1992
--- tar/regex.h	Fri Sep 11 15:34:59 1992
***************
*** 456,466 ****

  #else /* not __STDC__ */

- /* Support old C compilers.  */
- #define const
-
  extern reg_syntax_t re_set_syntax ();
! extern char *re_compile_pattern ();
  extern int re_search (), re_search_2 ();
  extern int re_match (), re_match_2 ();
  extern void re_set_registers ();
--- 456,463 ----

  #else /* not __STDC__ */

  extern reg_syntax_t re_set_syntax ();
! extern const char *re_compile_pattern ();
  extern int re_search (), re_search_2 ();
  extern int re_match (), re_match_2 ();
  extern void re_set_registers ();


Newsgroups: gnu.utils.bug