1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-26 10:39:01 +02:00
Commit Graph

19593 Commits

Author SHA1 Message Date
Jim Meyering c5b7dbc58e (zaptemp): Mark new diagnostic for translation. 2004-11-14 08:36:30 +00:00
Jim Meyering 1dc343bb3a *** empty log message *** 2004-11-14 00:40:03 +00:00
Jim Meyering efc10a4914 Do require gl_FUNC_FPENDING. 2004-11-14 00:34:04 +00:00
Jim Meyering 17b50219bd . 2004-11-14 00:33:27 +00:00
Jim Meyering 21bf149e86 . 2004-11-14 00:32:50 +00:00
Jim Meyering d4ad5906ca . 2004-11-14 00:29:36 +00:00
Jim Meyering fa83bf0b37 . 2004-11-14 00:20:33 +00:00
Jim Meyering f094ac4413 (close_stdout): Don't fail just because stdout was
closed initially, since some programs don't write to stdout in the
normal course of operation (other than --version and --help), and
we don't want this function to make e.g. `cp 1 2 >&-' fail.
But do fail if it was closed and someone has tried to write to it.
E.g., printf 'foo' >&-
2004-11-14 00:20:01 +00:00
Jim Meyering d417dd764f (libfetish_a_SOURCES): Add __fpending.h. 2004-11-14 00:19:28 +00:00
Jim Meyering 9406daed19 Restore these files. They're useful after all. 2004-11-14 00:19:01 +00:00
Jim Meyering 8ce39412c3 New file. Test today's closeout.c change. 2004-11-14 00:17:24 +00:00
Jim Meyering 545e8add4d (TESTS): Add close-stdout. 2004-11-14 00:17:10 +00:00
Paul Eggert 7e8e1db3d3 * src/sort.c (zaptemp): Warn if a temporary file is not removed. 2004-11-13 04:49:14 +00:00
Paul Eggert af6bd870f4 (zaptemp): Warn if a temporary file is not removed.
Prune unnecessary accesses to volatile locations, and take some
code out of the critical section that didn't need to be in it.
2004-11-13 04:45:58 +00:00
Paul Eggert 1b2e96f830 Make the newly-introduced critical section a bit smaller. 2004-11-13 01:02:48 +00:00
Paul Eggert fc19c2ddad * src/sort.c: Avoid O(N**2) behavior when there are many temporary files.
Fix a race condition.
2004-11-13 00:53:23 +00:00
Paul Eggert 54e862641b Document today's changes to "sort". 2004-11-13 00:52:32 +00:00
Paul Eggert 8aed6ea305 Avoid O(N**2) behavior when there are many temporary files.
(temptail): New variable, so that we can easily append to list.
(create_temp_file): Create new files at end of list, so that
searching the list has O(N**NMERGE) behavior instead of O(N**2).
(zaptemp): Update temptail if needed.
(mergefps, merge): Accept new arg that counts temp files, and keep it
up to date as we create and remove temporaries.  This is for
efficiency, so that we don't call zaptemp so often.
All callers changed.
(sort): Don't create array in reverse order, since the list of
temporaries is now in the correct order.

(zaptemp): Protect against race condition: if 'sort' is
interrupted in the middle of zaptemp, it might unlink the
temporary file twice, and the second time this happens the file
might already have been created by some other process.

(create_temp_file): Use offsetof for clarity.
(die): Move it up earlier, to clean up the code a bit.
2004-11-13 00:50:56 +00:00
Paul Eggert 0174a06214 Move "Version" to top. 2004-11-12 19:37:10 +00:00
Paul Eggert 222bd8934b Support longer page numbers in "pr", and allow most file names starting
with "+".
2004-11-12 19:36:51 +00:00
Paul Eggert 80877e6a38 Document recent changes to "pr". 2004-11-12 19:36:18 +00:00
Paul Eggert 48eaa73827 (strtoumax): Declare if not declared.
(skip_to_page, first_page_number, last_page_number, page_number,
first_last_page, print_header):
Use uintmax_t for page numbers.
(first_last_page): Remove unnecessary forward declaration.
Do not modify arg (it is now a const pointer).
Return a true if successful, false (without print a diagnostic)
otherwise.
(main): If +XXX does not specify a valid page range, treat it
as a file name.  This follows the response to Open Group XCU ERN 41
<http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>,
which says the behavior is allowed.
(skip_to_page): When starting page number exceeds page count,
print both numbers in the diagnostic.
(print_header): Detect page number overflow.
2004-11-12 19:35:54 +00:00
Paul Eggert 3c530e63c5 Sync from gnulib and regenerate. 2004-11-12 06:00:01 +00:00
Jim Meyering e5839b5b28 remove trailing blanks 2004-11-11 09:19:42 +00:00
Paul Eggert 9d8ce0f399 Sync from gnulib. 2004-11-11 06:07:57 +00:00
Paul Eggert d2b4386d29 Sync from gnulib. 2004-11-11 05:02:14 +00:00
Jim Meyering f0dd13bca8 *** empty log message *** 2004-11-10 08:24:58 +00:00
Paul Eggert 443e4a9026 Sync from gnulib. 2004-11-09 20:54:43 +00:00
Jim Meyering 3b9295c319 *** empty log message *** 2004-11-09 20:31:46 +00:00
Jim Meyering 594d5064c9 [__APPLE__]: Include <mach/machine.h> and <mach-o/arch.h>.
(main) [__APPLE__]: Get the processor type via syscall rather than
hard-coding "powerpc".  From toby@opendarwin.org.
2004-11-09 20:31:39 +00:00
Jim Meyering 15c10278a7 *** empty log message *** 2004-11-07 07:05:43 +00:00
Jim Meyering 4d223551d7 (merge): Remove declarations of now-unused variables. 2004-11-07 07:05:38 +00:00
Paul Eggert faba9a39bc * src/sort.c: Avoid some silly merges. 2004-11-06 23:47:13 +00:00
Paul Eggert a31bc04af0 (first_same_file): Remove. Move most of the code to....
(avoid_trashing_input): New function.
(merge): Avoid some silly merges, e.g., copying a single file to
a temporary file when there are exactly 17 input files to merge.
Take a count of temporary files rather than a max_merge arg.
All uses changed.
2004-11-06 23:46:47 +00:00
Jim Meyering 7d354a1286 . 2004-11-06 22:46:44 +00:00
Jim Meyering eee82e1382 remove now-unused files 2004-11-06 22:46:21 +00:00
Jim Meyering 569ae8c54b . 2004-11-06 22:45:58 +00:00
Jim Meyering 37edf32068 (libfetish_a_SOURCES): Remove __fpending.h, now that it's no longer used. 2004-11-06 22:45:47 +00:00
Jim Meyering b1635d809b . 2004-11-06 22:44:56 +00:00
Jim Meyering 65a7fb91ae remove now-unused file 2004-11-06 22:44:48 +00:00
Jim Meyering 23b19be323 Don't require gl_FUNC_FPENDING. 2004-11-06 22:44:14 +00:00
Jim Meyering 078c89bb76 *** empty log message *** 2004-11-06 22:37:28 +00:00
Jim Meyering d77d7fe158 Ensure that no close failure goes unreported.
(close_stdout): Always close stdout.  I.e., don't
return early when it seems there's nothing to flush.
Don't include __fpending.h.
2004-11-06 22:37:23 +00:00
Jim Meyering d73a00981c (xfclose): Don't close stdout here (just flush it),
since close_stdout now closes stdout unconditionally.
2004-11-06 22:37:02 +00:00
Paul Eggert 3e0f7c5dc3 * src/sort.c: Fixx size_t and alloca bugs. 2004-11-05 23:02:46 +00:00
Paul Eggert 8a0f42dff9 (inittables, sort_buffer_size, getmonth, mergefps,
first_same_file, merge, sort, main): Use size_t for indexes into arrays.
This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
temporary files).
(getmonth, keycompare, compare): Rewrite to avoid need for alloca,
thus avoiding unchecked stack overflow in some cases.  As a side
effect this improve the performance of "sort -M" by a factor of 4
on my benchmarks.
2004-11-05 23:02:09 +00:00
Paul Eggert 5312181e5b Regenerate. 2004-11-04 00:02:19 +00:00
Jim Meyering 0753839f7a remove trailing spaces 2004-11-03 23:31:20 +00:00
Paul Eggert 3b39a3022a Log recent getdate-etc. related changes. 2004-11-03 23:25:32 +00:00
Paul Eggert 80b4895f7a Sync from gnulib. 2004-11-03 23:24:07 +00:00