<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/sort.c, branch v7.2</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v7.2</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-03-18T20:44:37Z</updated>
<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>
<entry>
<title>sort: Fix two bugs with determining the end of field</title>
<updated>2009-02-26T14:40:28Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-02-24T08:37:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=224a69b56b716f57e3a018af5a9b9379f32da3fc'/>
<id>urn:sha1:224a69b56b716f57e3a018af5a9b9379f32da3fc</id>
<content type='text'>
* src/sort.c: When no specific number of chars to skip
is specified for the end field, always skip the whole field.
Also never include leading spaces from next field.
* tests/misc/sort: Add 2 new tests for these cases.
* NEWS: Mention this bug fix.
* THANKS: Add bug reporter.
Reported by Davide Canova.
</content>
</entry>
<entry>
<title>doc: Improve description of --files0-from option</title>
<updated>2008-12-01T02:09:19Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2008-12-01T02:09:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=00b5a2db33cddadf641ae2f01534514314d7e817'/>
<id>urn:sha1:00b5a2db33cddadf641ae2f01534514314d7e817</id>
<content type='text'>
* doc/coreutils.texi: Describe the most common
usage of --files0-from=- to read names from stdin.
* src/du.c: Likewise.
* src/sort.c: Likewise.
* src/wc.c: Likewise.
</content>
</entry>
<entry>
<title>make --help print "Report PROGRAM translation bugs to &lt;...&gt;."</title>
<updated>2008-11-10T07:19:52Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-09T16:15:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=43448b049341d9b88293f38eb941759820f42e84'/>
<id>urn:sha1:43448b049341d9b88293f38eb941759820f42e84</id>
<content type='text'>
for all but the C/POSIX locale.
* src/system.h: Include "hard-locale.h".
(emit_bug_reporting_address): Tell where to report translation bugs.

don't include "hard-locale.h", now that system.h does
* src/comm.c: Likewise.
* src/join.c: Likewise.
* src/ls.c: Likewise.
* src/pinky.c: Likewise.
* src/pr.c: Likewise.
* src/sort.c: Likewise.
* src/uniq.c: Likewise.
* src/who.c: Likewise.
</content>
</entry>
<entry>
<title>avoid warnings about discarding "qualifiers from pointer target type"</title>
<updated>2008-11-10T07:11:59Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-10-28T21:06:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=854284f7887677395239c1085b27a09e834291b7'/>
<id>urn:sha1:854284f7887677395239c1085b27a09e834291b7</id>
<content type='text'>
Use the new "bad_cast" function or an actual cast-to-"(char *)"
to avoid warnings.
* src/system.h (bad_cast): Define.
* src/chown.c (main):
* src/chroot.c (main):
* src/date.c (main):
* src/du.c (main):
* src/expand.c (stdin_argv):
* src/ls.c (decode_switches):
* src/md5sum.c (main):
* src/paste.c (main):
* src/pr.c (col_sep_string, column_separator, line_separator, main):
* src/sort.c (main):
* src/split.c (main):
* src/tail.c (main):
* src/unexpand.c (stdin_argv):
* src/yes.c (main):
</content>
</entry>
<entry>
<title>ls and sort: use filevercmp instead of strverscmp</title>
<updated>2008-10-03T09:59:17Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2008-10-03T09:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e505736f8211a608b00dfe75fb186a5211e1a183'/>
<id>urn:sha1:e505736f8211a608b00dfe75fb186a5211e1a183</id>
<content type='text'>
* src/ls.c (cmp_version): Use filevercmp instead of strverscmp.
* src/sort.c (usage): Remove mna reference to strverscmp(3).
(compare_version): Use filevercmp instead of strverscmp.
* bootstrap.conf: Add filevercmp to list of gnulib modules.
* tests/misc/sort-version: Remove conflicting string and enhance test.
* NEWS: Mention the change.
</content>
</entry>
<entry>
<title>sort --help: sort the options better alphabetically</title>
<updated>2008-09-19T10:27:37Z</updated>
<author>
<name>Benno Schulenberg</name>
<email>bensberg@justemail.net</email>
</author>
<published>2008-08-24T13:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3b39aa796fd57af518d6ab9bbc63ef171cefe605'/>
<id>urn:sha1:3b39aa796fd57af518d6ab9bbc63ef171cefe605</id>
<content type='text'>
Take the opportunity to split the long message into three parts.
</content>
</entry>
<entry>
<title>sort: improve usage wording</title>
<updated>2008-08-19T03:52:04Z</updated>
<author>
<name>Eric Blake</name>
<email>ebb9@byu.net</email>
</author>
<published>2008-08-19T03:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=edd292f8d4a5845bcc0d01ab080a6fc9f51a36fa'/>
<id>urn:sha1:edd292f8d4a5845bcc0d01ab080a6fc9f51a36fa</id>
<content type='text'>
* src/sort.c (usage): Mention that -k defaults to end of line if
POS2 omitted.
* THANKS: Update.
Reported by Tim Ryan.

Signed-off-by: Eric Blake &lt;ebb9@byu.net&gt;
</content>
</entry>
<entry>
<title>adjust</title>
<updated>2008-08-15T08:18:51Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-08-15T07:48:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=929479026b3fd5910c165c22e1fae9f02e773342'/>
<id>urn:sha1:929479026b3fd5910c165c22e1fae9f02e773342</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sort: new option, --sort=version, for version number ordering</title>
<updated>2008-08-15T07:52:06Z</updated>
<author>
<name>Bruce Korb</name>
<email>bkorb@gnu.org</email>
</author>
<published>2008-08-14T13:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4c9fae4e97d95a9f89d1399a8aeb03051f0fec96'/>
<id>urn:sha1:4c9fae4e97d95a9f89d1399a8aeb03051f0fec96</id>
<content type='text'>
* src/sort.c [struct keyfield] (version): New member.
(usage): Describe --version-sort.
(sort_options): Add 'V'.
(long_options): Add "version-sort".
(CHECK_TABLE, _ct_, SORT_TABLE, _st_): Define new macros.
(check_args, sort_args, sort_types): Use these new macros in declarations.
(ARGMATCH_VERIFY): Remove use.  No longer needed.
(compare_version): New function.
(key_compare): Add a case.
(check_ordering_compatibility): Handle new type.
(main): Likewise.  Reformat two expressions for readability.
* tests/misc/sort-version: new test file
* tests/Makefile.am: add it to the list
* doc/coreutils.texi (sort invocation): Document it.
* NEWS: Mention the new feature.
</content>
</entry>
</feed>
