From b767f301ea376bedcdfecef42ed5275185b428e8 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Fri, 9 Sep 2005 04:55:09 +0000 Subject: [PATCH] usage fixes, tinfo and programe for pstree --- ChangeLog | 7 +++++++ configure.in | 7 ++++--- src/fuser.c | 21 +++++++++++---------- src/killall.c | 2 +- src/pstree.c | 9 ++++----- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ba7be3..1ce8367 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,13 @@ Changes in 21.7 * fuser prints F instead of f is access is write, thanks to Tet. * pstree checks to see it is a real tty Debian #326500 * pstree shows child threads with {commandname} Debian #230924 + * better capitalisation with usage SF# 1150042 + + * Applied psmisc-21.4-alt-progname to find pstrees name + * configure.in checks for tinfo library + * both above fixes from ALTLinux + + Changes in 21.6 =============== diff --git a/configure.in b/configure.in index 28eaec5..cd326bd 100644 --- a/configure.in +++ b/configure.in @@ -25,9 +25,10 @@ fi AC_SUBST([SELINUX_LIB]) dnl Checks for libraries. -AC_CHECK_LIB([ncurses], [tgetent], [TERMCAP_LIB=-lncurses], [ - AC_CHECK_LIB([termcap], [tgetent], [TERMCAP_LIB=-ltermcap], [ - AC_MSG_ERROR([Cannot find ncurses or termcap libraries]) ]) ]) +AC_CHECK_LIB(tinfo, tgetent, TERMCAP_LIB=-ltinfo, + AC_CHECK_LIB(ncurses, tgetent, TERMCAP_LIB=-lncurses, + AC_CHECK_LIB(termcap, tgetent, TERMCAP_LIB=-ltermcap, + AC_MSG_ERROR(Cannot find tinfo, ncurses or termcap libraries) ) ) ) AC_SUBST([TERMCAP_LIB]) dnl Checks for header files. diff --git a/src/fuser.c b/src/fuser.c index 4530082..0ae7da3 100644 --- a/src/fuser.c +++ b/src/fuser.c @@ -76,21 +76,22 @@ static void usage (const char *errormsg) fprintf(stderr, "%s\n", errormsg); fprintf (stderr, _( - "usage: fuser [ -a | -s | -c ] [ -n space ] [ -signal ] [ -kimuv ] name ...\n" - " [ - ] [ -n space ] [ -signal ] [ -kimuv ] name ...\n" + "Usage: fuser [ -a | -s | -c ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME...\n" + " [ - ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME...\n" " fuser -l\n" - " fuser -V\n\n" + " fuser -V\n" + "Show which processes use the named files, sockets, or filesystems.\n\n " " -a display unused files too\n" " -c mounted FS\n" " -f silently ignored (for POSIX compatibility)\n" - " -k kill processes accessing that file\n" " -i ask before killing (ignored without -k)\n" - " -l list signal names\n" - " -m mounted FS\n" - " -n space search in the specified name space (file, udp, or tcp)\n" + " -k kill processes accessing the named file\n" + " -l list available signal names\n" + " -m show all processes using the named filesystems\n" + " -n SPACE search in this name space (file, udp, or tcp)\n" " -s silent operation\n" - " -signal send signal instead of SIGKILL\n" - " -u display user ids\n" + " -SIGNAL send this signal instead of SIGKILL\n" + " -u display user IDs\n" " -v verbose output\n" " -V display version information\n" " -4 search IPv4 sockets only\n" @@ -102,7 +103,7 @@ static void usage (const char *errormsg) void print_version() { - fprintf(stderr, _("fuser (psmisc) %s\n"), VERSION); + fprintf(stderr, _("fuser (PSmisc) %s\n"), VERSION); fprintf(stderr, _( "Copyright (C) 1993-2005 Werner Almesberger and Craig Small\n\n")); fprintf(stderr, _( diff --git a/src/killall.c b/src/killall.c index 2c4ece8..d476835 100644 --- a/src/killall.c +++ b/src/killall.c @@ -414,7 +414,7 @@ usage_killall (void) "Usage: killall [-Z CONTEXT] [ -egiqvw ] [ -SIGNAL ] NAME...\n")); #else /*WITH_SELINUX*/ fprintf(stderr, _( - "Usage: killall [OPTIONS]... [--] NAME...\n")); + "Usage: killall [OPTION]... [--] NAME...\n")); #endif /*WITH_SELINUX*/ fprintf(stderr, _( " killall -l, --list\n" diff --git a/src/pstree.c b/src/pstree.c index ee78422..830786f 100644 --- a/src/pstree.c +++ b/src/pstree.c @@ -48,6 +48,8 @@ #include #endif /*WITH_SELINUX*/ +extern const char *__progname; + #ifndef MAX_DEPTH #define MAX_DEPTH 100 #endif @@ -803,11 +805,8 @@ main (int argc, char **argv) textdomain(PACKAGE); #endif - if ( (tmpstr = strrchr(argv[0],'/'))) { - tmpstr++; - if (strcmp(tmpstr, "pstree.x11") ==0) - wait_end=1; - } + if (!strcmp(__progname, "pstree.x11")) + wait_end=1; /* * Attempt to figure out a good default symbol set. Will be overriden by -- 2.40.0