Re: How to find character special files dependencies for a program or library?
On 6/14/07, Martijn Ras [EMAIL PROTECTED] wrote: Heya Folks, Is there any way to find the character special files for a program or library? Similar to using ldd to find the libraries for a program ... Not really, but strings(1) and (on GNU/Linux) strace(1) or ltrace(1) might help.Bear in mind that the latter will only tell you about files the program actually opened or attempted to open, not the files it decided not to bother trying on the basis of some other fact. James. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: How to find character special files dependencies for a program or library?
Martijn Ras wrote on 14-06-07 23:18: Heya Folks, Is there any way to find the character special files for a program or library? Similar to using ldd to find the libraries for a program ... Mazzel, Martijn. At runtime: lsof. Ja, de mazzel! bjd ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: An error
Paul Eggert [EMAIL PROTECTED] wrote: James Youngman [EMAIL PROTECTED] writes: Arguably this is a documentation deficiency. I agree; here's a proposed patch. 2007-06-14 Paul Eggert [EMAIL PROTECTED] * doc/coreutils.texi (cat invocation): Blank lines actually mean empty lines. * src/cat.c (usage): Say that nonblank means nonempty. Clarify --squeeze-blank. Thank you! I've applied that. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
FYI: Don't include quote.h when it is not used.
Since checking for quotearg.h found a few, I check for quote.h, now, too: Don't include quote.h when it is not used. * src/md5sum.c: Remove unnecessary inclusion of quote.h. * src/expr.c: Likewise. * src/shred.c: Likewise. * Makefile.maint (sc_prohibit_quote_without_use): New rule. Signed-off-by: Jim Meyering [EMAIL PROTECTED] --- ChangeLog |9 + Makefile.maint | 12 src/c99-to-c89.diff |2 +- src/expr.c |3 +-- src/md5sum.c|3 +-- src/shred.c |3 +-- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc0d246..c1cc6aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-06-15 Jim Meyering [EMAIL PROTECTED] + + Don't include quote.h when it is not used. + * src/md5sum.c: Remove unnecessary inclusion of quote.h. + * src/expr.c: Likewise. + * src/shred.c: Likewise. + * Makefile.maint (sc_prohibit_quote_without_use): New rule. + * src/c99-to-c89.diff: Adjust offsets. + 2007-06-14 Paul Eggert [EMAIL PROTECTED] Clarify what cat documentation means by blank lines. diff --git a/Makefile.maint b/Makefile.maint index ba5166b..bb666a4 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -179,6 +179,18 @@ sc_prohibit_quotearg_without_use: else :; \ fi +# Don't include quote.h unless you use one of its functions. +sc_prohibit_quote_without_use: + @if $(CVS_LIST_EXCEPT) | grep '\.c$$' /dev/null; then \ + files=$$(grep -l '# *include quote\.h' \ + $$($(CVS_LIST_EXCEPT) | grep '\.c$$'))\ + grep -LE '\quote(_n)? \(' $$files\ + | grep .\ + { echo $(ME): the above files include quote.h but don't use it \ + 12; exit 1; } || :; \ + else :; \ + fi + sc_obsolete_symbols: @grep -nE '\(HAVE''_FCNTL_H|O''_NDELAY)\' \ $$($(CVS_LIST_EXCEPT)) \ diff --git a/src/c99-to-c89.diff b/src/c99-to-c89.diff index 4e1aa4a..e4d2abf 100644 --- a/src/c99-to-c89.diff +++ b/src/c99-to-c89.diff @@ -106,7 +106,7 @@ retrieving revision 1.130 diff -u -p -r1.130 shred.c --- a/src/shred.c 3 Sep 2006 02:53:16 - 1.130 +++ b/src/shred.c 3 Oct 2006 13:48:24 - -@@ -464,7 +464,7 @@ dopass (int fd, char const *qname, off_t +@@ -463,7 +463,7 @@ dopass (int fd, char const *qname, off_t out. Thus, it shouldn't give up on bad blocks. This code works because lim is always a multiple of SECTOR_SIZE, except at the end. */ diff --git a/src/expr.c b/src/expr.c index 57c2591..47f5832 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1,5 +1,5 @@ /* expr -- evaluate expressions. - Copyright (C) 86, 1991-1997, 1999-2006 Free Software Foundation, Inc. + Copyright (C) 86, 1991-1997, 1999-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,6 @@ #include long-options.h #include error.h #include inttostr.h -#include quote.h #include quotearg.h #include strnumcmp.h #include xstrtol.h diff --git a/src/md5sum.c b/src/md5sum.c index f637bae..4330e85 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -1,5 +1,5 @@ /* Compute MD5, SHA1, SHA224, SHA256, SHA384 or SHA512 checksum of files or strings - Copyright (C) 1995-2006 Free Software Foundation, Inc. + Copyright (C) 1995-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,6 @@ #endif #include getline.h #include error.h -#include quote.h #include stdio--.h /* The official name of this program (e.g., no `g' prefix). */ diff --git a/src/shred.c b/src/shred.c index fc6ad67..788f0e7 100644 --- a/src/shred.c +++ b/src/shred.c @@ -1,6 +1,6 @@ /* shred.c - overwrite files and devices to make it harder to recover data - Copyright (C) 1999-2006 Free Software Foundation, Inc. + Copyright (C) 1999-2007 Free Software Foundation, Inc. Copyright (C) 1997, 1998, 1999 Colin Plumb. This program is free software; you can redistribute it and/or modify @@ -101,7 +101,6 @@ #include human.h #include inttostr.h #include quotearg.h /* For quotearg_colon */ -#include quote.h /* For quotearg_colon */ #include randint.h #include randread.h -- ___ Bug-coreutils mailing list Bug-coreutils@gnu.org
Re: FYI: bug-fix: cp would fail to write through a dangling symlink
In rereading my proposed patch http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00145.html I discovered that I sent in the wrong ChangeLog entry. I inadvertently omitted the part of the ChangeLog that described Jim Meyering's contribution. My apologies! Here's the corrected ChangeLog entry for that patch: 2007-06-14 Paul Eggert [EMAIL PROTECTED] * NEWS: cp no longer considers a destination symlink to be the same as the referenced file when copying links or making backups. * src/copy.c (copy_reg): When following a symlink, used the followed name in later chown etc. requests, so that the created file is affected, rather than the symlink. Use O_NOFOLLOW on source when not dereferencing symlinks; this avoids a race. Preserve errno correctly when doing multiple open attempts on the destination. (copy_internal): Follow destination symlinks only when copying a regular file and only when we don't intend to remove or rename the destination first, regardless of whether following source symlinks; this is because since POSIX and tradition (e.g., FreeBSD) says we should ordinarily follow destination symlinks if the system calls would ordinarily do so. * src/copy.h (struct cp_options): Add comment that 'dereference' is only for source files. * src/cp.c (usage): Note that --derereference etc. are only for source files. (make_dir_parents_private): Follow symlinks, regardless of whether --dereference is specified, because these are destination symlinks. * tests/cp/same-file: Adjust tests to match revised behavior. Filter out perror output since it might vary from host to host. Use sed alone instead of also using echo. * doc/coreutils.texi (cp invocation): Document the behavior better when the destination is a symlink. Clarify source versus destination symlinks. Describe the new behavior for destination symlinks. 2007-06-14 Jim Meyering [EMAIL PROTECTED] * src/copy.c: Include canonicalize.h. (copy_reg): Use canonicalize_filename_mode to follow the symlink, so that we can always open with O_EXCL and avoid a race. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: ls should not color output when --color=auto is used in environment TERM=dumb
On 6/13/07, Bob Proulx [EMAIL PROTECTED] wrote: Improving this seems like a reasonable enhancement. If you think changing the behavior of --color=auto will break things, I can do --color=smart, i.e. the TERMinal is not dumb. -Lenny ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: ls should not color output when --color=auto is used in environment TERM=dumb
Lenny Domnitser wrote: On 6/13/07, Bob Proulx [EMAIL PROTECTED] wrote: Improving this seems like a reasonable enhancement. If you think changing the behavior of --color=auto will break things, I can do --color=smart, i.e. the TERMinal is not dumb. Given that dumb isn't the only terminal type that doesn't support color, and that dircolors ostensibly knows (non-comprehensively) which ones do, I'd still vote for letting dircolors do the term detection (that it already does), and have ls handle a set-but-empty LS_COLORS accordingly. For my part, I'm having a hard time envisioning any problems that could be caused by using --color=auto for this; at least, exporting an empty LS_COLORS when one means for ls to rely on its default color settings seems an unnatural idiom: leaving LS_COLORS unset (for instance, by neglecting to evaluate dircolors' output) seems a much more natural idiom, and I would hope that's how people who want the defaults are already doing it. Additionally, if there are some people who are using the method that will become broken, it will be easy to fix, and will not cause any loss in functionality or breakage elsewhere, since it is inconceivable that scripts parsing ls's output would be relying upon ls to output some particular color sequences (or, even any color sequences). -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: FYI: bug-fix: cp would fail to write through a dangling symlink
Paul Eggert [EMAIL PROTECTED] wrote: In rereading my proposed patch http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00145.html Thanks again for a fine patch. I've applied it. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils