libbb: introduce and use xrename and rename_or_warn.

This commit is contained in:
Denis Vlasenko
2008-02-17 14:28:53 +00:00
parent ffae845cfd
commit cb448fe01b
10 changed files with 33 additions and 39 deletions

View File

@@ -512,10 +512,7 @@ int sendgetmail_main(int argc, char **argv)
if (fd < 0)
bb_perror_msg_and_die("cannot create unique file");
close(fd);
if (rename(tmp_name, new_name) < 0) {
// something is very wrong
bb_perror_msg_and_die("cannot move %s to %s", tmp_name, new_name);
}
xrename(tmp_name, new_name);
}
// delete message from server