diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/diff.c | 5 | ||||
-rw-r--r-- | editors/patch.c | 3 | ||||
-rw-r--r-- | editors/sed.c | 4 |
3 files changed, 4 insertions, 8 deletions
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]) | |||
685 | */ | 685 | */ |
686 | if (lseek(fd, 0, SEEK_SET) == -1 && errno == ESPIPE) { | 686 | if (lseek(fd, 0, SEEK_SET) == -1 && errno == ESPIPE) { |
687 | char name[] = "/tmp/difXXXXXX"; | 687 | char name[] = "/tmp/difXXXXXX"; |
688 | int fd_tmp = mkstemp(name); | 688 | int fd_tmp = xmkstemp(name); |
689 | if (fd_tmp < 0) | 689 | |
690 | bb_perror_msg_and_die("mkstemp"); | ||
691 | unlink(name); | 690 | unlink(name); |
692 | if (bb_copyfd_eof(fd, fd_tmp) < 0) | 691 | if (bb_copyfd_eof(fd, fd_tmp) < 0) |
693 | xfunc_die(); | 692 | xfunc_die(); |
diff --git a/editors/patch.c b/editors/patch.c index fff06907f..33ff8b569 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -200,8 +200,7 @@ int copy_tempfile(int fdin, char *name, char **tempname) | |||
200 | int fd; | 200 | int fd; |
201 | 201 | ||
202 | *tempname = xasprintf("%sXXXXXX", name); | 202 | *tempname = xasprintf("%sXXXXXX", name); |
203 | fd = mkstemp(*tempname); | 203 | fd = xmkstemp(*tempname); |
204 | if(-1 == fd) bb_perror_msg_and_die("no temp file"); | ||
205 | 204 | ||
206 | // Set permissions of output file | 205 | // Set permissions of output file |
207 | fstat(fdin, &statbuf); | 206 | fstat(fdin, &statbuf); |
diff --git a/editors/sed.c b/editors/sed.c index 8d9f7b25b..964d0405e 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -1370,9 +1370,7 @@ int sed_main(int argc UNUSED_PARAM, char **argv) | |||
1370 | } | 1370 | } |
1371 | 1371 | ||
1372 | G.outname = xasprintf("%sXXXXXX", argv[i]); | 1372 | G.outname = xasprintf("%sXXXXXX", argv[i]); |
1373 | nonstdoutfd = mkstemp(G.outname); | 1373 | nonstdoutfd = xmkstemp(G.outname); |
1374 | if (-1 == nonstdoutfd) | ||
1375 | bb_perror_msg_and_die("can't create temp file %s", G.outname); | ||
1376 | G.nonstdout = xfdopen_for_write(nonstdoutfd); | 1374 | G.nonstdout = xfdopen_for_write(nonstdoutfd); |
1377 | 1375 | ||
1378 | /* Set permissions/owner of output file */ | 1376 | /* Set permissions/owner of output file */ |