aboutsummaryrefslogtreecommitdiff
path: root/miscutils/crond.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-02-17 14:28:53 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-02-17 14:28:53 +0000
commitcb448fe01bbe75ef31c3190e8b63b0e1a320ffb4 (patch)
tree9757477193c1b8f3be9a772cabfb1ef92639240e /miscutils/crond.c
parentffae845cfd0a0b9872827d806984841d4cfee104 (diff)
downloadbusybox-cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4.tar.gz
busybox-cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4.tar.bz2
libbb: introduce and use xrename and rename_or_warn.
Diffstat (limited to 'miscutils/crond.c')
-rw-r--r--miscutils/crond.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 0df143ae7..9721a8a9a 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -548,7 +548,7 @@ static void CheckUpdates(void)
fi = fopen(CRONUPDATE, "r");
if (fi != NULL) {
- remove(CRONUPDATE);
+ unlink(CRONUPDATE);
while (fgets(buf, sizeof(buf), fi) != NULL) {
SynchronizeFile(strtok(buf, " \t\r\n"));
}
@@ -579,7 +579,7 @@ static void SynchronizeDir(void)
* scan directory and add associated users
*/
- remove(CRONUPDATE);
+ unlink(CRONUPDATE);
if (chdir(CDir) < 0) {
crondlog("\311cannot find %s\n", CDir);
}
@@ -814,7 +814,7 @@ ForkJob(const char *user, CronLine * line, int mailFd,
crondlog("\024cannot fork\n");
line->cl_Pid = 0;
if (mail_filename) {
- remove(mail_filename);
+ unlink(mail_filename);
}
} else if (mail_filename) {
/* PARENT, FORK SUCCESS
@@ -823,7 +823,7 @@ ForkJob(const char *user, CronLine * line, int mailFd,
char mailFile2[128];
snprintf(mailFile2, sizeof(mailFile2), TMPDIR "/cron.%s.%d", user, pid);
- rename(mail_filename, mailFile2);
+ rename(mail_filename, mailFile2); // TODO: xrename?
}
/*
* Close the mail file descriptor.. we can't just leave it open in
@@ -896,7 +896,7 @@ static void EndJob(const char *user, CronLine * line)
*/
mailFd = open(mailFile, O_RDONLY);
- remove(mailFile);
+ unlink(mailFile);
if (mailFd < 0) {
return;
}