forked from pool/timezone
Dirk Mueller
33844d212b
- tzcode-link.diff: refresh patch to apply correctly on older versions of the distribution. OBS-URL: https://build.opensuse.org/request/show/201982 OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=120
38 lines
905 B
Diff
38 lines
905 B
Diff
Index: timezone-2013g/zic.c
|
|
===================================================================
|
|
--- timezone-2013g.orig/zic.c
|
|
+++ timezone-2013g/zic.c
|
|
@@ -593,6 +593,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)
|
|
{
|
|
@@ -627,6 +644,8 @@ dolink(const char *const fromfield, cons
|
|
exit(EXIT_FAILURE);
|
|
|
|
result = link(fromname, toname);
|
|
+ if (result != 0)
|
|
+ result = copy(fromname, toname);
|
|
if (result != 0) {
|
|
const char *s = fromfield;
|
|
const char *t;
|