Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Generate command line when SMALL is defined and make ...



details:   https://anonhg.NetBSD.org/src/rev/f5e976864592
branches:  trunk
changeset: 555776:f5e976864592
user:      dsl <dsl%NetBSD.org@localhost>
date:      Thu Nov 27 21:16:14 2003 +0000

description:
Generate command line when SMALL is defined and make buffer full sized.
All the code has been present for a while, and the memory cost is (about)
180 bytes per process.
Fixes PR bin/23545

diffstat:

 bin/sh/jobs.c |  8 +++-----
 bin/sh/jobs.h |  6 +-----
 2 files changed, 4 insertions(+), 10 deletions(-)

diffs (59 lines):

diff -r fb9c7de58f3e -r f5e976864592 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Thu Nov 27 18:26:46 2003 +0000
+++ b/bin/sh/jobs.c     Thu Nov 27 21:16:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.c,v 1.60 2003/11/14 10:27:10 dsl Exp $    */
+/*     $NetBSD: jobs.c,v 1.61 2003/11/27 21:16:14 dsl Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c     8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.60 2003/11/14 10:27:10 dsl Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.61 2003/11/27 21:16:14 dsl Exp $");
 #endif
 #endif /* not lint */
 
@@ -874,10 +874,8 @@
                ps->pid = pid;
                ps->status = -1;
                ps->cmd[0] = 0;
-#ifndef SMALL
                if (/* iflag && rootshell && */ n)
                        commandtext(ps, n);
-#endif
        }
        TRACE(("In parent shell:  child = %d\n", pid));
        return pid;
@@ -1210,7 +1208,7 @@
        int len;
 
        cmdnextc = ps->cmd;
-       if (iflag || mflag)
+       if (iflag || mflag || sizeof ps->cmd < 100)
                len = sizeof(ps->cmd);
        else
                len = sizeof(ps->cmd) / 10;
diff -r fb9c7de58f3e -r f5e976864592 bin/sh/jobs.h
--- a/bin/sh/jobs.h     Thu Nov 27 18:26:46 2003 +0000
+++ b/bin/sh/jobs.h     Thu Nov 27 21:16:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.h,v 1.18 2003/08/07 09:05:33 agc Exp $    */
+/*     $NetBSD: jobs.h,v 1.19 2003/11/27 21:16:14 dsl Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -57,11 +57,7 @@
  * latter case, pidlist will be non-NULL, and will point to a -1 terminated
  * array of pids.
  */
-#ifdef SMALL
-#define        MAXCMDTEXT      20
-#else
 #define        MAXCMDTEXT      200
-#endif
 
 struct procstat {
        pid_t   pid;            /* process id */



Home | Main Index | Thread Index | Old Index