Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/bin/ps Pull up revisions 1.63-1.65 (requested by hubertf):



details:   https://anonhg.NetBSD.org/src/rev/c8f0660c989f
branches:  netbsd-1-5
changeset: 490556:c8f0660c989f
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Sat Jan 27 07:06:45 2001 +0000

description:
Pull up revisions 1.63-1.65 (requested by hubertf):
  Clarify meaning of COMMANDs printed in parentheses. Addresses PR11930.

diffstat:

 bin/ps/print.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (66 lines):

diff -r d68a6fd7d758 -r c8f0660c989f bin/ps/print.c
--- a/bin/ps/print.c    Sat Jan 27 07:06:40 2001 +0000
+++ b/bin/ps/print.c    Sat Jan 27 07:06:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: print.c,v 1.55 2000/06/08 13:30:40 simonb Exp $        */
+/*     $NetBSD: print.c,v 1.55.2.1 2001/01/27 07:06:45 jhawk Exp $     */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
 #if 0
 static char sccsid[] = "@(#)print.c    8.6 (Berkeley) 4/16/94";
 #else
-__RCSID("$NetBSD: print.c,v 1.55 2000/06/08 13:30:40 simonb Exp $");
+__RCSID("$NetBSD: print.c,v 1.55.2.1 2001/01/27 07:06:45 jhawk Exp $");
 #endif
 #endif /* not lint */
 
@@ -157,6 +157,10 @@
        }
 }
 
+/* 
+ * Return 1 if the the command name in the argument vector (u-area) does
+ * not match the command name (p_comm)
+ */
 static int
 titlecmp(name, argv)
        char *name;
@@ -165,19 +169,24 @@
        char *title;
        int namelen;
 
+
+       /* no argument vector == no match; system processes/threads do that */
        if (argv == 0 || argv[0] == 0)
                return (1);
 
        title = cmdpart(argv[0]);
 
+       /* the basename matches */
        if (!strcmp(name, title))
                return (0);
 
+       /* handle login shells, by skipping the leading - */
        if (title[0] == '-' && !strcmp(name, title+1))
                return (0);
 
        namelen = strlen(name);
 
+       /* handle daemons that report activity as daemonname: activity */
        if (argv[1] == 0 &&
            !strncmp(name, title, namelen) &&
            title[namelen + 0] == ':' &&
@@ -304,6 +313,11 @@
                                        fmt_putc(' ', &left);
                                }
                        }
+                       /*
+                        * append the real command name within
+                        * parentheses, if the command name does
+                        * not match the one in the argument vector
+                        */
                        if (titlecmp(name, argv)) {
                                fmt_putc('(', &left);
                                fmt_puts(name, &left);



Home | Main Index | Thread Index | Old Index