aboutsummaryrefslogtreecommitdiff
path: root/sysutils/anacron/files/patch-runjob.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/anacron/files/patch-runjob.c')
-rw-r--r--sysutils/anacron/files/patch-runjob.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sysutils/anacron/files/patch-runjob.c b/sysutils/anacron/files/patch-runjob.c
index a984d32ce1bb..781ea1693057 100644
--- a/sysutils/anacron/files/patch-runjob.c
+++ b/sysutils/anacron/files/patch-runjob.c
@@ -9,8 +9,6 @@
- int fd, i;
+ int fd;
+ char name[] = "/tmp/anacron.XXXXXX";
-+
-+ fd = mkstemp(name);
- i = 0;
- name = NULL;
@@ -25,6 +23,8 @@
- /* I'm not sure we actually need to be so persistent here */
- } while (fd == -1 && errno == EEXIST && i < max_retries);
-
++ fd = mkstemp(name);
++
if (fd == -1) die_e("Can't open temporary file");
if (unlink(name)) die_e("Can't unlink temporary file");
- free(name);
@@ -32,3 +32,12 @@
fcntl(fd, F_SETFD, 1); /* set close-on-exec flag */
return fd;
}
+@@ -84,7 +72,7 @@ username()
+ }
+
+ static void
+-xputenv(const char *s)
++xputenv(char *s)
+ {
+ if (putenv(s)) die_e("Can't set the environment");
+ }