diff options
author | Alexander Shishkin <virtuoso@slind.org> | 2010-10-22 13:27:16 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-22 13:27:16 +0200 |
commit | 6722737ece4b8db3e30b53aef8f981f53db1621e (patch) | |
tree | 8e2ddb1d3a43d595ac4584e3d1ef23f49a462bf4 /editors/sed.c | |
parent | cbfeaac7afe31323d46c52da3b98a949232d708e (diff) | |
download | busybox-w32-6722737ece4b8db3e30b53aef8f981f53db1621e.tar.gz busybox-w32-6722737ece4b8db3e30b53aef8f981f53db1621e.tar.bz2 busybox-w32-6722737ece4b8db3e30b53aef8f981f53db1621e.zip |
*: introduce and use xmkstemp. -65 bytes.
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'editors/sed.c')
-rw-r--r-- | editors/sed.c | 4 |
1 files changed, 1 insertions, 3 deletions
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 */ |