mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-23 09:56:42 +08:00
split: honor $TMPDIR for temp files
* bootstrap.conf: Depend on tmpdir rather than tmpfile, as the standard tmpfile() doesn't honor $TMPDIR. * src/split.c (copy_to_tmpfile): Adjust to call temp_stream() rather than tmpfile(); * NEWS: Mention the improvement.
This commit is contained in:
parent
1b86b70dd5
commit
464be62df6
2
NEWS
2
NEWS
@ -68,6 +68,8 @@ GNU coreutils NEWS -*- outline -*-
|
||||
split now uses more tuned access patterns for its potentially large input.
|
||||
This was seen to improve throughput by 5% when reading from SSD.
|
||||
|
||||
split now supports a configurable $TMPDIR for handling any temporary files.
|
||||
|
||||
tac now falls back to '/tmp' if a configured $TMPDIR is unavailable.
|
||||
|
||||
|
||||
|
@ -274,7 +274,7 @@ gnulib_modules="
|
||||
time_rz
|
||||
timer-time
|
||||
timespec
|
||||
tmpfile
|
||||
tmpdir
|
||||
tzset
|
||||
uname
|
||||
unicodeio
|
||||
|
@ -396,6 +396,7 @@ src_arch_SOURCES = src/uname.c src/uname-arch.c
|
||||
src_cut_SOURCES = src/cut.c src/set-fields.c
|
||||
src_numfmt_SOURCES = src/numfmt.c src/set-fields.c
|
||||
|
||||
src_split_SOURCES = src/split.c src/temp-stream.c
|
||||
src_tac_SOURCES = src/tac.c src/temp-stream.c
|
||||
|
||||
src_tail_SOURCES = src/tail.c src/iopoll.c
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "quote.h"
|
||||
#include "sig2str.h"
|
||||
#include "sys-limits.h"
|
||||
#include "temp-stream.h"
|
||||
#include "xbinary-io.h"
|
||||
#include "xdectoint.h"
|
||||
#include "xstrtol.h"
|
||||
@ -279,8 +280,8 @@ CHUNKS may be:\n\
|
||||
static off_t
|
||||
copy_to_tmpfile (int fd, char *buf, idx_t bufsize)
|
||||
{
|
||||
FILE *tmp = tmpfile ();
|
||||
if (!tmp)
|
||||
FILE *tmp;
|
||||
if (!temp_stream (&tmp, nullptr))
|
||||
return -1;
|
||||
off_t copied = 0;
|
||||
off_t r;
|
||||
|
Loading…
Reference in New Issue
Block a user