]> granicus.if.org Git - psmisc/commitdiff
usage fixes, tinfo and programe for pstree
authorCraig Small <csmall@users.sourceforge.net>
Fri, 9 Sep 2005 04:55:09 +0000 (04:55 +0000)
committerCraig Small <csmall@users.sourceforge.net>
Fri, 9 Sep 2005 04:55:09 +0000 (04:55 +0000)
ChangeLog
configure.in
src/fuser.c
src/killall.c
src/pstree.c

index 6ba7be3918069040c622f08cc5f7bd4a47a00ce0..1ce8367e275c6ab6cf1e039867d8526dece6f6ba 100644 (file)
--- 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
 ===============
index 28eaec5f6764cd104c7331c817b9d9d29a9b4c3c..cd326bddc9359ef3a12bf7da717ab0597128aa6f 100644 (file)
@@ -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.
index 4530082055c5347b2cfd9271a96c46af0da21d5b..0ae7da3df0daf33ec69c1627b8b3bc5162a3087a 100644 (file)
@@ -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, _(
index 2c4ece83a29f33344f4c444fd01688265dfb0134..d4768356b949088aa8e8aaa143ea9a23e738dba7 100644 (file)
@@ -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"
index ee78422b905231dfea211589b6d984f99ad2e637..830786fbaf8b7dfb3681d11373de8d05d18872dc 100644 (file)
@@ -48,6 +48,8 @@
 #include <selinux/selinux.h>
 #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