From cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 17 Feb 2008 14:28:53 +0000 Subject: libbb: introduce and use xrename and rename_or_warn. --- miscutils/crond.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'miscutils') diff --git a/miscutils/crond.c b/miscutils/crond.c index 0df143a..9721a8a 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; } -- cgit v1.1