<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/sort.c, branch v7.5</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v7.5</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v7.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-08-18T09:02:36Z</updated>
<entry>
<title>sort: use more portable initialization syntax</title>
<updated>2009-08-18T09:02:36Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-08-18T09:01:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ea57d4648226fc3d713a10448fc4fc012ccacdf5'/>
<id>urn:sha1:ea57d4648226fc3d713a10448fc4fc012ccacdf5</id>
<content type='text'>
* src/sort.c (find_unit_order): Spell out 256-element static
initializer, rather than relying on C99 syntax.
Required for Forte Developer 7 C 5.4 2002/03/09 on Solaris 10.
Reported by Bernhard Voelker.
</content>
</entry>
<entry>
<title>sort: allow SI and IEC units on separate human sort fields</title>
<updated>2009-07-03T16:00:55Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-06-29T23:52:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=acc01947af2e025d11016f3a4b0a26beb06dd120'/>
<id>urn:sha1:acc01947af2e025d11016f3a4b0a26beb06dd120</id>
<content type='text'>
* src/sort.c: Store the si_present state per key rather than globally
* tests/misc/sort: Add a check that would have previously failed.
Also add a test to demonstrate that invalid IEC/SI mixtures are not
always noticed when they're not significant to the sort.
</content>
</entry>
<entry>
<title>sort: Ignore fields where end position is before the start position</title>
<updated>2009-06-13T00:25:06Z</updated>
<author>
<name>Cliff Miller</name>
<email>cbm@whatexit.org</email>
</author>
<published>2009-06-11T17:30:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=24c727d3c26122c4f1c29381e7c6f5d96985ccca'/>
<id>urn:sha1:24c727d3c26122c4f1c29381e7c6f5d96985ccca</id>
<content type='text'>
* NEWS: Mention the fix
* THANKS: Add Cliff Miller
* src/sort.c (keycompare): Ensure lima &gt;= texta
* tests/misc/sort: Add 3 corresponding tests

Signed-off-by: Pádraig Brady &lt;P@draigBrady.com&gt;
</content>
</entry>
<entry>
<title>sort: die immediately upon heap allocation failure</title>
<updated>2009-06-07T11:58:24Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-06-07T11:55:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f9a950b87f996c7f66b5a09e94662cfc9d35bc6d'/>
<id>urn:sha1:f9a950b87f996c7f66b5a09e94662cfc9d35bc6d</id>
<content type='text'>
* src/sort.c (register_proc): Handle hash_insert failure.
</content>
</entry>
<entry>
<title>sort: new --human-numeric-sort option to sort KiB MB etc.</title>
<updated>2009-05-26T13:49:17Z</updated>
<author>
<name>Michael Speer</name>
<email>knomenet@gmail.com</email>
</author>
<published>2009-04-27T13:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=159faba1376ffd5a46fe4bbc780d85dd3e502cea'/>
<id>urn:sha1:159faba1376ffd5a46fe4bbc780d85dd3e502cea</id>
<content type='text'>
* NEWS: Document the new option
* doc/coreutils.texi (sort invocation): ditto
* src/sort.c (main): handle the new --human-numeric-sort option (-h).
(human_numcompare): A new function to compare SI and IEC suffixes
before falling back to the standard --numeric comparison.
(find_unit_order): A new helper function to find the order
of magnitude of a number string as determined by its suffix.
(check_mixed_SI_IEC): A new helper function to exit with error
if both SI and IEC suffixes are presented.
* tests/misc/sort: Add 8 tests to test the new functionality.
* THANKS: Update
</content>
</entry>
<entry>
<title>maint: use ARRAY_CARDINALITY more</title>
<updated>2009-05-17T11:59:12Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-05-17T11:02:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9593a3d8e78ece58deab5a30632021322bbc16d0'/>
<id>urn:sha1:9593a3d8e78ece58deab5a30632021322bbc16d0</id>
<content type='text'>
* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it.
* src/factor.c (WHEEL_END): Likewise.
* src/csplit.c (main): Likewise.
* src/od.c: Likewise,
* src/ls.c (main): Likewise.
(N_ENTRIES): Remove definition.  Use ARRAY_CARDINALITY instead.
* src/dircolors.c: Likewise.
(array_len): Remove definition.
</content>
</entry>
<entry>
<title>sort -m: don't segfault when output file is also an input file</title>
<updated>2009-04-23T19:03:14Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-04-22T06:45:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=25eb4c69097ca4f5665b050cfa4247a19ffd8c55'/>
<id>urn:sha1:25eb4c69097ca4f5665b050cfa4247a19ffd8c55</id>
<content type='text'>
* src/sort.c (avoid_trashing_input): Fix an off-by-one error and
guard the use of memmove.
* NEWS (Bug fixes): Mention it.
* tests/misc/sort: Add tests to exercise the offending code.
* THANKS: Update.
Reported by Otavio Salvador in http://bugs.debian.org/525048.
</content>
</entry>
<entry>
<title>shred,sort,shuf: don't use /dev/urandom by default</title>
<updated>2009-04-07T18:01:46Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-04-06T07:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=af5723c71e3efbfe60266162ebb5d07b45d72725'/>
<id>urn:sha1:af5723c71e3efbfe60266162ebb5d07b45d72725</id>
<content type='text'>
Suggestion from Steven Schveighoffer at:
http://savannah.gnu.org/patch/?6797
to greatly speed up the random passes done by shred.
* gl/lib/randread.c: Default to using the internal
pseudorandom generator, rather than reading /dev/urandom
* src/shred.c (usage): remove mention of /dev/urandom
* src/shuf.c (usage); ditto
* src/sort.c (usage): ditto
* doc/coreutils.text: Document the new behaviour
for aquiring random data.
</content>
</entry>
<entry>
<title>doc: Clarify the help for version sorting in ls and sort</title>
<updated>2009-04-02T12:53:43Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-04-01T17:59:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=34f0c3e52208bbd80da4d0be4b5541dca03a6e10'/>
<id>urn:sha1:34f0c3e52208bbd80da4d0be4b5541dca03a6e10</id>
<content type='text'>
* src/ls.c: Update the -v help description
* src/sort.c: Update the -V help description
</content>
</entry>
<entry>
<title>sort: handle fd exhaustion better when merging</title>
<updated>2009-03-18T20:44:37Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@CS.UCLA.EDU</email>
</author>
<published>2009-03-13T22:48:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8f7fae59727e0a050a4833705a6f7849ba2c4531'/>
<id>urn:sha1:8f7fae59727e0a050a4833705a6f7849ba2c4531</id>
<content type='text'>
This is an alternative to my 9 March patch labeled "Silently lower
nmerge; don't (sometimes incorrectly) range-check"
&lt;http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00070.html&gt;.
It differs by not using 'dup' to probe for extra file descriptors;
instead, it simply calls 'open' (and 'pipe') to open files and pipes,
until one of these calls fails due to file descriptor exhaustion; it
then backs off by 1, does a merge with the files that it has opened,
and then retries with the (now-smaller) number of files.

This patch requires quite a few more changes to the source code than
the earlier patch, but it is in some sense "better" because it doesn't
need to call "dup" ahead of time in order to decide whether "open" or
"pipe" will fail.  Also, it's more robust in the case where "open" or
"pipe" fails with errno==EMFILE because some system-wide limit is
exhausted.

* src/sort.c (create_temp_file): New arg SURVIVE_FD_EXHAUSTION.
(stream_open): New function, containing guts of xfopen.
(xfopen): Use it.
(pipe_fork): Set errno on failure.
(maybe_create_temp): New function, containing guts of create_temp.
(create_temp): Use it.
(open_temp): Distinguish failures due to file descriptor exhaustion
from other failures, and on fd exhaustion return a notice to caller
rather than dying.  Don't test execlp's return value; when it returns,
it *always* returns -1.
(open_input_files): New function.
(mergefps): New arg FPS. It's now the caller's responsibility to open
the input and output files.  All callers changed.
(mergefiles): New function.
(avoid_trashing_input, merge): Handle the case where a single merge
can't merge as much as we wanted due to file descriptor exhaustion, by
merging as much as we can and then retrying.
* tests/Makefile.am (TESTS): Add misc/sort-continue.
* tests/misc/sort-continue: New file.
* THANKS: Add Glen Lenker and Matt Pham who coauthored this patch.
</content>
</entry>
</feed>
