forked from pool/timezone
0bee29b8fb
Copy from Base:System/timezone based on submit request 48685 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/48685 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/timezone?expand=0&rev=33
36 lines
757 B
Diff
36 lines
757 B
Diff
--- zic.c 2010-01-06 16:21:33.000000000 +0100
|
|
+++ zic.c 2010-06-01 01:34:12.000000000 +0200
|
|
@@ -614,6 +614,23 @@
|
|
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(fromfield, tofield)
|
|
const char * const fromfield;
|
|
@@ -649,6 +666,8 @@
|
|
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 &&
|