2013-10-04 21:37:35 +02:00
|
|
|
Index: timezone-2013g/zic.c
|
2012-10-29 20:13:44 +01:00
|
|
|
===================================================================
|
2013-10-04 21:37:35 +02:00
|
|
|
--- timezone-2013g.orig/zic.c
|
|
|
|
+++ timezone-2013g/zic.c
|
|
|
|
@@ -593,6 +593,23 @@ _("%s: More than one -L option specified
|
2010-09-21 18:21:55 +02:00
|
|
|
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
|
2012-10-29 20:13:44 +01:00
|
|
|
dolink(const char *const fromfield, const char *const tofield)
|
|
|
|
{
|
2013-10-04 21:37:35 +02:00
|
|
|
@@ -627,6 +644,8 @@ dolink(const char *const fromfield, cons
|
2010-09-21 18:21:55 +02:00
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
|
|
|
result = link(fromname, toname);
|
|
|
|
+ if (result != 0)
|
|
|
|
+ result = copy(fromname, toname);
|
2013-10-04 21:37:35 +02:00
|
|
|
if (result != 0) {
|
2013-10-23 10:14:47 +02:00
|
|
|
const char *s = fromname;
|
2013-10-04 21:37:35 +02:00
|
|
|
const char *t;
|