another proposol to fix the zic -l bug

Ulrich Drepper drepper at cygnus.com
Tue Jan 20 23:13:30 UTC 1998


Hi,

could the appended patch be considered for the next tzcode release?
It is an IMO cleaner rewrite since it preserve the old semantic and
allows the symlink function (which isn't available on SysV) be skipped
by defining a simple symbol.

Thanks,

-- Uli
---------------.      drepper at gnu.org  ,-.   Rubensstrasse 5
Ulrich Drepper  \    ,-------------------'   \  76149 Karlsruhe/Germany
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: zic.c
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/time/zic.c,v
retrieving revision 1.22
diff -c -r1.22 zic.c
*** zic.c	1997/12/22 20:49:08	1.22
--- zic.c	1998/01/20 23:09:26
***************
*** 601,610 ****
  	if (!itsdir(toname))
  		(void) remove(toname);
  	if (link(fromname, toname) != 0) {
! 		if (mkdirs(toname) != 0)
! 			(void) exit(EXIT_FAILURE);
! 		if (link(fromname, toname) != 0) {
! 			const char *e = strerror(errno);
  
  			(void) fprintf(stderr,
  				_("%s: Can't link from %s to %s: %s\n"),
--- 601,623 ----
  	if (!itsdir(toname))
  		(void) remove(toname);
  	if (link(fromname, toname) != 0) {
! 		int failure = errno;
! 		if (failure == ENOENT)
! 			if (mkdirs(toname) != 0)
! 				failure = errno;
! 			else if (link(fromname, toname) == 0)
! 				failure = 0;
! 			else
! 				failure = errno;
! #ifndef MISSING_SYMLINK
! 		if (failure == EXDEV)
! 			if (symlink(fromname, toname) != 0)
! 				failure = errno;
! 			else
! 				failure = 0;
! #endif
! 		if (failure) {
! 			const char *e = strerror(failure);
  
  			(void) fprintf(stderr,
  				_("%s: Can't link from %s to %s: %s\n"),
  




More information about the tz mailing list