summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2008-10-25seq: revert Solaris 8 work-around that caused x86 regressionPaul Eggert
* src/seq.c: Don't include <math.h>, <float.h>. (abs_rel_diff): Remove. (print_numbers): Test for equality, not for an epsilonish value. This reverts 4827dd27b0c655a685947aaa01426a5ecba179f3, aka v6.10-185-g4827dd2, which broke 'seq' on the x86; for example, it causes "seq 9223372036854775807 9223372036854775808" to incorrectly output 3 numbers instead of 2. It's better to punish obsolescent hosts that have incorrectly-working floating-point than to punish correctly-working hosts. * tests/misc/seq: Use 0.9000000000000, rather than 0.90000000000000000000, to avoid tickling a bug in Solaris 8 strtold, which converts "0.9" and "0.9000000000000" correctly, but incorrectly converts "0.90000000000000000000" to a smaller value.
2008-10-24group-list: avoid compiler warningEric Blake
* src/group-list.c (print_group_list) [!HAVE_GETGROUPS]: Always return value.
2008-10-23ls: use '.' (not +) as SELinux-only alt. access flag in ls -l outputJim Meyering
* src/ls.c (gobble_file) [long_format]: Map SELinux-only to '.', any other nonempty combination of MAC and ACL to '+', and all else to the usual ' '. Suggested by Michael Stone. * tests/misc/selinux: Adapt: expect '.', not '+'. * doc/coreutils.texi (What information is listed): Document this. * NEWS (Changes in behavior): Mention it.
2008-10-22* src/ls.c (usage): Describe exit statuses more concisely.Paul Eggert
2008-10-21ls: make it possible to disable file capabilities checkingKamil Dudka
* ls.c (print_color_indicator): Do not check for file capability if that attribute is not being colored. Since 84f6abfe00b4ab533145623638b417a2221f9c75, ls --color would check each file for "capabilities". In <http://bugzilla.redhat.com/467508>, James Antill reported that ls --color seemed slower with capabilities detection.
2008-10-21reflect gnulib's removal of lstat.hJim Meyering
* src/copy.h: Don't include "lstat.h". * src/ls.c: Likewise. * src/remove.c: Likewise. * src/rm.c: Likewise.
2008-10-20expr: Fixup authorsPádraig Brady
* src/expr.c: Standardise the format of AUTHORS to that used in other utils with multiple authors. Also add Paul Eggert since he basically rewrote it with his bignum fixes. * AUTHORS (expr): Add Paul Eggert.
2008-10-19accommodate gnulib header removalsJim Meyering
* src/copy.c: Don't include "euidaccess.h" or "lchmod.h". * src/cp.c: Don't include "lchmod.h". * src/ls.c: Don't include "dirfd.h". * src/mkdir.c: Don't include "lchmod.h". * src/pwd.c: Don't include "dirfd.h". * src/remove.c: Don't include "dirfd.h" or "euidaccess.h". * src/test.c: Don't include "euidaccess.h". * gl/modules/getloadavg.diff: Adjust diff for changed context. * src/uptime.c (uptime): Remove declaration.
2008-10-17maint: avoid warning in ls.cJim Meyering
* src/ls.c (has_capability) [!HAVE_CAP]: Add unused attribute.
2008-10-17maint: avoid warnings due to attribute warn_unused_resultJim Meyering
Now that a (void) cast no longer suffices to ignore warnings from gcc about uses of functions marked with the warn_unused_result attribute, we need an alternative. For the record, here's one of the ignorable warnings: "copy.c:233: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result" * bootstrap.conf (gnulib_modules): Import ignore-value. * src/copy.c: Include "ignore-value.h". (set_owner): Use ignore_value in place of "(void)" casts, to ignore lchown and fchown failures. * src/cp.c (re_protect): Likewise, to ignore lchown failure. * src/remove.c (preprocess_dir): Remove unnecessary "(void)" cast.
2008-10-16mktemp: diagnose freopen failureJim Meyering
* src/mktemp [--quiet]: Don't ignore freopen failure.
2008-10-16* src/mktemp.c (main): Add 'const' twice to avoid GCC warning.Paul Eggert
2008-10-16csplit: prefer sigaction over signalEric Blake
* bootstrap.conf (gnulib_modules): Import sigaction. * src/csplit.c (sigprocmask, siginterrupt) [SA_NOCLDSTOP]: Delete workarounds. (interrupt_handler, main): Drop use of signal. Rely on sigaction to block fatal signal during cleanup, and to restore it to default in case of nested signals.
2008-10-15expr: remove --bignum and --no-bignum optionsPaul Eggert
* doc/coreutils.texi (expr invocation): Remove the --bignum and --no-bignum options. They weren't really needed, and they broke longstanding (albeit nonportable) scripts. * src/expr.c: Don't include <assert.h>. Include "inttostr.h", "long-options.h", "verify.h". Check at compile-time that size_t fits in unsigned long int, as the code assumes this in several places. (HAVE_GMP): Define to 0 if not defined, for convenience. (mpz_t, mpz_clear, mpz_init_set_ui, mpz_init_set_str, mpz_add): (mpz_sub, mpz_mul, mpz_tdiv_q, mpz_tdiv_r, mpz_get_str, mpz_sgn): (mpz_fits_ulong_p, mpz_get_ui, mpz_out_str): Supply substitutes when !HAVE_GMP, which work well enough for expr's purposes. (mp_integer): Remove. All integers are gmp, if gmp is available. (struct valinfo): Remove 'z' member; no longer needed. The 'i' member is always of type mpz_t. (enum arithmetic_mode, MP_NEVER, MP_ALWAYS, MP_AUTO, mode): Remove; no longer needed. (usage): Remove documentation of --bignum and --no-bignum. (integer_overflow): Abort if error misbehaves, to pacify GCC. Restore old message on arithmetic overflow, to be conservative. (die): Omit exit_status parameter; not needed (is always EXPR_FAILURE). (string_too_long, USE_BIGNUM, NO_USE_BIGNUM, long_options): Remove; no longer needed. (main): Don't use getopt_long; this breaks old nonportable scripts. (int_value): Arg is unsigned, in case we have strings whose length exceeds LONG_MAX (!). (int_value, freev, printv, null, tostring, toarith): (eval6, eval4, eval3): Always use mpz_ functions, to simplify the code. (substr_value): Remove; no longer needed. (getsize): Simplify the API: one arg rather than 3. Don't assume unsigned long int fits in size_t. (promote, domult, dodivide, doadd): Remove; no longer needed. * tests/misc/expr: Don't use --bignum to test for bignum support. Instead, use big numbers to test this.
2008-10-15expr: don't interpret argv[0] as an operandJim Meyering
* src/expr.c (main): Given a first argument like -22 (negative, with two or more digits), expr would decrement optind to 0 and then attempt to evaluate argv[0].
2008-10-13doc: adjust spacing in ls --help output, for better man formattingJim Meyering
* src/ls.c (usage): Adjust spacing so the "Exit status:" list renders well in the help2man-generated man page.
2008-10-13doc: ls: clarify exit status descriptionOndřej Vašík
* src/ls.c (exit_status): Clarify comments. (usage): Clarify exit status description in --help output. * doc/coreutils.texi (ls invocation): Clarify exit status documentation Reported by Greg Metcalfe in <http://bugzilla.redhat.com/446294>.
2008-10-12tests: move check-misc targets from src/Makefile.am to maint.mkJim Meyering
* src/Makefile.am (check): Remove check-misc. (check-misc): Remove target. * maint.mk (sc_prohibit_stat_st_blocks): New target. (sc_prohibit_S_IS_definition): New target. * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_stat_st_blocks. * .x-sc_prohibit_stat_st_blocks: New file. Andreas Schwab reported that "make check" could fail to detect violation of the no-S_IS*-definition policy.
2008-10-06chcon: remove traces of unimplemented --change (-c) optionOndřej Vašík
This option was never supported in upstream coreutils. * chcon.c (usage): Remove --change (-c) from help message. (main): Remove 'c' from getopt string. Remove related and now-unused enums.
2008-10-06stat: add lustre filesystem typeAndreas Dilger
* src/stat.c (human_fstype) [S_MAGIC_LUSTRE]: Add case. Make "stat -f" recognize the "Lustre" filesystem type. <http://en.wikipedia.org/wiki/Lustre_(file_system)> * NEWS: Mention this feature.
2008-10-06remove.c: avoid compile failure on OS/2Jim Meyering
* src/remove.c (dirent_inode_sort_may_be_useful): Guard also with "#if defined __linux__". Reported by Elbert Pol.
2008-10-03timeout.c: don't use perror; exit 125 upon failed forkJim Meyering
* src/timeout.c (main): Use "error", not perror. Elbert Pol noticed a build failure on OS/2. * src/timeout.c (main): Exit 125 (not errno) upon failed fork. Make the failed fork diagnostic match the one from install.c.
2008-10-03ls and sort: use filevercmp instead of strverscmpKamil Dudka
* 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.
2008-10-02ignore additional built fileEric Blake
2008-10-02remove.c: allow compilation on cygwinEric Blake
* src/remove.c (dirent_inode_sort_may_be_useful) [!HAVE_STRUCT_DIRENT_D_TYPE]: Elide definition when there is no point in trying to use it.
2008-10-01remove.c: combine two helper functions, to avoid sign-extensionJim Meyering
* src/remove.c (fs_handles_readdir_ordered_dirents_efficiently): Remove function, so as not to have to worry about the type of statfs.f_type and sign extension. (dirent_inode_sort_may_be_useful): Adjust comment. Perform the switch directly on the struct.member here, instead. Andreas Schwab spotted the potential for a sign-extension bug, that happens not to bite for the S_* f_type values currently used.
2008-10-01rm: don't preprocess a directory on a file system of type tmpfs or nfsJim Meyering
The preprocessing phase is not necessary on tmpfs, and induces a 20% performance decrease when removing a 2M-entry directory. * src/remove.c (fs_handles_readdir_ordered_dirents_efficiently): (dirent_inode_sort_may_be_useful): New functions from gnulib/fts.c. They'll probably become a gnulib module -- eventually. (preprocess_dir): Use dirent_inode_sort_may_be_useful.
2008-09-29seq: solve e13188e7ef7bbd609c1586332a335b4194b881aa more cleanlyJim Meyering
* src/seq.c (print_numbers): Don't switch c_strtold -> strtold in order to accommodate the locale-dependent behavior of our internal asprintf use. Instead, simply set the locale to C before calling asprintf, and then set it back afterwards.
2008-09-28mktemp: plug an inconsequential leakJim Meyering
* src/mktemp.c (main) [lint]: Free template.
2008-09-27remove.c: avoid compiler warningEric Blake
* src/remove.c (compare_ino, dirent_count) [!HAVE_STRUCT_DIRENT_D_TYPE]: Mask declaration when unused. Signed-off-by: Eric Blake <ebb9@byu.net>
2008-09-27rm -r: avoid O(n^2) performance for a directory with very many entriesJim Meyering
This enhancement works around a problem that is specific to at least ext3 and ext4 file systems. With them, it would take hours to remove a two-million-entry directory. RAM-backed file systems (tmpfs) are not affected, since there is no seek penalty. * remove.c (rm_malloc, rm_free, compare_ino): New functions. (dirent_count, preprocess_dir): New function. [struct readdir_data]: New struct. (remove_cwd_entries): Call preprocess_dir. * tests/rm/ext3-perf: New file. Test for the performance fix. * NEWS: mention the new feature
2008-09-27remove.c: don't use xmalloc; don't let obstack call exit on failureJim Meyering
(obstack_chunk_alloc, obstack_chunk_free): Don't define. (top_dir): Param is no longer "const". Use malloc, not xmalloc, and call longjmp upon failed malloc. (obstack_init_minimal): New function. (ds_init): Don't use xmalloc. Instead, use caller-supplied buffer. Use obstack_specify_allocation_with_arg, not obstack_init, so that we control what happens upon allocation failure. Arrange for ds_free not to free uninitialized if/when any obstack_specify_allocation_with_arg allocation fails. (ds_free): Don't free DS, now that it's no longer malloc'd. (rm): Allocate DS on the stack. Arrange to handle ds_init allocation failure. step1
2008-09-26seq -0.1 0.1 2: print final number when locale's decimal point is ","Jim Meyering
* src/seq.c (print_numbers): Use strtold, not c_strtold to convert from just-formatted-using-asprintf string back to double, since asprintf may have used something other than "." as the decimal point. Reported by lsof@nodata.co.uk as <http://bugzilla.redhat.com/463556>. Thanks to Ondřej Vašík for discovering that the bug was locale-related. $ LC_ALL=cs_CZ.UTF-8 seq -0.1 0.1 2|grep 2.0 [Exit 1] $ seq -0.1 0.1 2|grep 2.0 2.0 * tests/check.mk (TESTS_ENVIRONMENT): Add LOCALE_FR_UTF8, for... * tests/misc/seq [locale-dec-pt]: New test for the above. * NEWS (bug fix): Mention it.
2008-09-24pinky: gettextize two missed stringsBenno Schulenberg
Additionally differentiate the strings for unknown idle time and unknown real name so they can be translated differently.
2008-09-24cp.c: adjust a comment to make it consistent with documentationJim Meyering
'-a' is equivalent to -dpR, so s/-dpPR/-dpR/; the -P is redundant, since -d already implies -P, and both --help and "info cp" say -dpR: Corresponding doc changes: 080ac7785071c7f135711a39e57c71d9057d9bd7 b7c2db676635518c06add0dd570543ae83e21f2e.
2008-09-22fix installation with ./ginstall in srcRalf Wildenhues
* src/Makefile.am (cu_install_program): New variable, set to either ./ginstall or @INSTALL_PROGRAM@ (for cross compilation). (INSTALL_PROGRAM): Override AC_SUBST unconditionally, to avoid warning, and wrong initialization order.
2008-09-19who --help: add a general descriptionBenno Schulenberg
2008-09-19uptime --help: put together message parts that belong togetherBenno Schulenberg
2008-09-19tr --help: gettextize a single paragraph as a single stringBenno Schulenberg
Breaking a paragraph into several strings is awkward for translators.
2008-09-19tail: gettextize the string, "standard input"Benno Schulenberg
2008-09-19tail --help: move the --retry entry into alphabetical orderBenno Schulenberg
* src/tail.c (usage): Also simplify --retry description, split a long string in two, remove a stray period, and add the usual indent.
2008-09-19shred --help: lowercase a stray capitalBenno Schulenberg
2008-09-19stty --help: correct the alignment of an entryBenno Schulenberg
* src/stty.c (usage): Also remove a stray period, and ungettextize a debugging message.
2008-09-19sort --help: sort the options better alphabeticallyBenno Schulenberg
Take the opportunity to split the long message into three parts.
2008-09-19rmdir --help: use lower case in option description; adjust indentationBenno Schulenberg
2008-09-19remove.c: move comment to right before string, so gettext will pick it upBenno Schulenberg
2008-09-19pr --help: elide arguments after short options that allow a spaceBenno Schulenberg
* src/pr.c (usage): Also, put the -S option with its description.
2008-09-19od: ungettextize debugging messagesBenno Schulenberg
2008-09-19nohup, remove, tr: also gettextize the alternative messagesBenno Schulenberg
2008-09-19od --help: avoid concatening two messages without a newlineBenno Schulenberg
src/od.c (usage): Better: make them into two separate paragraphs.