forked from pool/timezone
b57b471fe2
- update to 2012h (bnc#787005): * Samoa fall 2012 and later * Palestine fall 2012 * Bahia no longer has DST * Tocantins has DST * Israel has new DST rules next year * Jordan stays on DST this winter - update to 2012h (bnc#787005): * Samoa fall 2012 and later * Palestine fall 2012 * Bahia no longer has DST * Tocantins has DST * Israel has new DST rules next year * Jordan stays on DST this winter OBS-URL: https://build.opensuse.org/request/show/139567 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/timezone?expand=0&rev=66
38 lines
861 B
Diff
38 lines
861 B
Diff
Index: zic.c
|
|
===================================================================
|
|
--- zic.c.orig
|
|
+++ zic.c
|
|
@@ -576,6 +576,23 @@ _("%s: More than one -L option specified
|
|
return (errors == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
}
|
|
|
|
+static int
|
|
+copy(fromname, toname)
|
|
+const char * const fromname;
|
|
+const char * const toname;
|
|
+{
|
|
+ if (!fork()) {
|
|
+ execl("/bin/cp", "cp", fromname, toname, (char*) NULL);
|
|
+ _exit(1);
|
|
+ }
|
|
+ int s;
|
|
+ if (wait(&s) < 0)
|
|
+ return -1;
|
|
+ if (!WIFEXITED(s))
|
|
+ return -1;
|
|
+ return -WEXITSTATUS(s);
|
|
+}
|
|
+
|
|
static void
|
|
dolink(const char *const fromfield, const char *const tofield)
|
|
{
|
|
@@ -609,6 +626,8 @@ dolink(const char *const fromfield, cons
|
|
exit(EXIT_FAILURE);
|
|
|
|
result = link(fromname, toname);
|
|
+ if (result != 0)
|
|
+ result = copy(fromname, toname);
|
|
#if HAVE_SYMLINK
|
|
if (result != 0 &&
|
|
access(fromname, F_OK) == 0 &&
|