Re: libc/413: "zic -l" fails (cross-device link)

The appended patch should fix the problem you reported. I am not certain that this fix is the right one, and am cc:ing the tz maintainers for comments. zw Sun Jan 18 16:37:02 1998 Zack Weinberg <zack@rabi.phys.columbia.edu> * time/zic.c (dolink): Try symlink() if link() fails with EXDEV. --- zic.c.old Sun Jan 18 16:27:39 1998 +++ zic.c Sun Jan 18 16:36:29 1998 @@ -600,10 +600,10 @@ */ if (!itsdir(toname)) (void) remove(toname); + if (mkdirs(toname) != 0) + (void) exit(EXIT_FAILURE); if (link(fromname, toname) != 0) { - if (mkdirs(toname) != 0) - (void) exit(EXIT_FAILURE); - if (link(fromname, toname) != 0) { + if (errno != EXDEV || symlink(fromname, toname) != 0) { const char *e = strerror(errno); (void) fprintf(stderr,
participants (1)
-
Zack Weinberg