2012-10-27 14:44:04 +02:00
|
|
|
Index: timezone-2012h/zic.c
|
2012-08-25 23:03:54 +02:00
|
|
|
===================================================================
|
2012-10-27 14:44:04 +02:00
|
|
|
--- timezone-2012h.orig/zic.c
|
|
|
|
+++ timezone-2012h/zic.c
|
|
|
|
@@ -110,7 +110,7 @@ static int addtype(long gmtoff, const ch
|
|
|
|
static void leapadd(zic_t t, int positive, int rolling, int count);
|
|
|
|
static void adjleap(void);
|
|
|
|
static void associate(void);
|
2012-08-25 23:03:54 +02:00
|
|
|
-static void dolink(const char * fromfield, const char * tofield);
|
|
|
|
+static void dolink(const char * fromfield, const char * tofield, int defaultsymlink);
|
2012-10-27 14:44:04 +02:00
|
|
|
static long eitol(int i);
|
|
|
|
static char ** getfields(char * buf);
|
|
|
|
static long gethms(const char * string, const char * errstrng,
|
|
|
|
@@ -558,7 +558,7 @@ _("%s: More than one -L option specified
|
2012-08-25 23:03:54 +02:00
|
|
|
*/
|
|
|
|
for (i = 0; i < nlinks; ++i) {
|
|
|
|
eat(links[i].l_filename, links[i].l_linenum);
|
|
|
|
- dolink(links[i].l_from, links[i].l_to);
|
|
|
|
+ dolink(links[i].l_from, links[i].l_to, FALSE);
|
|
|
|
if (noise)
|
|
|
|
for (j = 0; j < nlinks; ++j)
|
|
|
|
if (strcmp(links[i].l_to,
|
2012-10-27 14:44:04 +02:00
|
|
|
@@ -567,17 +567,17 @@ _("%s: More than one -L option specified
|
2012-08-25 23:03:54 +02:00
|
|
|
}
|
|
|
|
if (lcltime != NULL) {
|
|
|
|
eat("command line", 1);
|
|
|
|
- dolink(lcltime, TZDEFAULT);
|
2012-10-27 14:44:04 +02:00
|
|
|
+ dolink(lcltime, TZDEFAULT, TRUE);
|
2012-08-25 23:03:54 +02:00
|
|
|
}
|
|
|
|
if (psxrules != NULL) {
|
|
|
|
eat("command line", 1);
|
|
|
|
- dolink(psxrules, TZDEFRULES);
|
2012-10-27 14:44:04 +02:00
|
|
|
+ dolink(psxrules, TZDEFRULES, FALSE);
|
2012-08-25 23:03:54 +02:00
|
|
|
}
|
|
|
|
return (errors == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-27 14:44:04 +02:00
|
|
|
-dolink(const char *const fromfield, const char *const tofield)
|
|
|
|
+dolink(const char *const fromfield, const char *const tofield, int defaultsymlink)
|
2012-08-25 23:03:54 +02:00
|
|
|
{
|
|
|
|
register char * fromname;
|
|
|
|
register char * toname;
|
2012-10-27 14:44:04 +02:00
|
|
|
@@ -602,15 +602,16 @@ dolink(const char *const fromfield, cons
|
2012-08-25 23:03:54 +02:00
|
|
|
*/
|
|
|
|
if (!itsdir(toname))
|
|
|
|
(void) remove(toname);
|
|
|
|
- if (link(fromname, toname) != 0) {
|
|
|
|
+ if (defaultsymlink || link(fromname, toname) != 0) {
|
|
|
|
int result;
|
|
|
|
|
|
|
|
if (mkdirs(toname) != 0)
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
|
|
|
- result = link(fromname, toname);
|
|
|
|
+ if (!defaultsymlink)
|
|
|
|
+ result = link(fromname, toname);
|
|
|
|
#if HAVE_SYMLINK
|
|
|
|
- if (result != 0 &&
|
|
|
|
+ if ((defaultsymlink || (!defaultsymlink && result != 0)) &&
|
|
|
|
access(fromname, F_OK) == 0 &&
|
|
|
|
!itsdir(fromname)) {
|
|
|
|
const char *s = tofield;
|