diff --git a/src/timezone/zic.c b/src/timezone/zic.c index 8d4347a..41b9a55 100644 --- a/src/timezone/zic.c +++ b/src/timezone/zic.c @@ -811,13 +811,19 @@ dolink(char const * fromfield, char const * tofield) link_errno = link(fromname, toname) == 0 ? 0 : errno; if (link_errno != 0) { +#ifdef HAVE_SYMLINK const char *s = fromfield; const char *t; char *p; size_t dotdots = 0; char *symlinkcontents; int symlink_result; +#endif + if (!mkdirs(toname)) + exit(EXIT_FAILURE); + +#ifdef HAVE_SYMLINK do t = s; while ((s = strchr(s, '/')) @@ -838,6 +844,7 @@ dolink(char const * fromfield, char const * tofield) strerror(link_errno)); } else +#endif { FILE *fp, *tp;