From 6722737ece4b8db3e30b53aef8f981f53db1621e Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Fri, 22 Oct 2010 13:27:16 +0200 Subject: *: introduce and use xmkstemp. -65 bytes. Signed-off-by: Alexander Shishkin Signed-off-by: Denys Vlasenko --- editors/diff.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'editors/diff.c') diff --git a/editors/diff.c b/editors/diff.c index 83de52753..d9d709db6 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -685,9 +685,8 @@ static int diffreg(char *file[2]) */ if (lseek(fd, 0, SEEK_SET) == -1 && errno == ESPIPE) { char name[] = "/tmp/difXXXXXX"; - int fd_tmp = mkstemp(name); - if (fd_tmp < 0) - bb_perror_msg_and_die("mkstemp"); + int fd_tmp = xmkstemp(name); + unlink(name); if (bb_copyfd_eof(fd, fd_tmp) < 0) xfunc_die(); -- cgit v1.2.3