Source-Changes-HG archive

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

[src/trunk]: src/bin/csh provide a way to reset setproctitle.



details:   https://anonhg.NetBSD.org/src/rev/3519607294e5
branches:  trunk
changeset: 986264:3519607294e5
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 16 19:34:21 2021 +0000

description:
provide a way to reset setproctitle.

diffstat:

 bin/csh/proc.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 0ff9d4391e71 -r 3519607294e5 bin/csh/proc.c
--- a/bin/csh/proc.c    Thu Sep 16 09:55:28 2021 +0000
+++ b/bin/csh/proc.c    Thu Sep 16 19:34:21 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: proc.c,v 1.41 2021/09/11 20:55:03 christos Exp $ */
+/* $NetBSD: proc.c,v 1.42 2021/09/16 19:34:21 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)proc.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: proc.c,v 1.41 2021/09/11 20:55:03 christos Exp $");
+__RCSID("$NetBSD: proc.c,v 1.42 2021/09/16 19:34:21 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -845,8 +845,12 @@
        if (v[1]) {
            if (eq(*v, STRml)) {
                flag |= FANCY | JOBDIR;
-           } else if (eq(*v, STRmZ) && v[1]) {
-               setproctitle("%s", short2str(v[1]));
+           } else if (eq(*v, STRmZ)) {
+               if (v[1] && v[1][0]) {
+                   setproctitle("%s", short2str(v[1]));
+               } else {
+                   setproctitle(NULL);
+               }
                return;
            } else {
                stderror(ERR_JOBS);



Home | Main Index | Thread Index | Old Index