From 772a9c3659a756ebecd1062c30c00e4c7e18f9c0 Mon Sep 17 00:00:00 2001 From: mmcc Date: Sun, 18 Oct 2015 18:05:35 +0000 Subject: [PATCH] Move more EXTERN-defined globals from sh.h. ok nicm@ --- bin/ksh/main.c | 10 +++++++++- bin/ksh/sh.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bin/ksh/main.c b/bin/ksh/main.c index b76d5565152..e85d38f4032 100644 --- a/bin/ksh/main.c +++ b/bin/ksh/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.65 2015/10/17 18:26:24 mmcc Exp $ */ +/* $OpenBSD: main.c,v 1.66 2015/10/18 18:05:35 mmcc Exp $ */ /* * startup, main loop, environments and error handling @@ -22,6 +22,14 @@ static void remove_temps(struct temp *tp); static int is_restricted(char *name); static void init_username(void); +const char *kshname; +pid_t kshpid; +pid_t procpid; +uid_t ksheuid; +int exstat; +int subst_exstat; +const char *safe_prompt; + /* * shell initialization */ diff --git a/bin/ksh/sh.h b/bin/ksh/sh.h index 208a4223345..058f87aad51 100644 --- a/bin/ksh/sh.h +++ b/bin/ksh/sh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sh.h,v 1.39 2015/10/17 18:43:22 mmcc Exp $ */ +/* $OpenBSD: sh.h,v 1.40 2015/10/18 18:05:35 mmcc Exp $ */ /* * Public Domain Bourne/Korn shell @@ -57,14 +57,14 @@ #define LINE 2048 /* input line size */ #define PATH 1024 /* pathname size (todo: PATH_MAX/pathconf()) */ -EXTERN const char *kshname; /* $0 */ -EXTERN pid_t kshpid; /* $$, shell pid */ -EXTERN pid_t procpid; /* pid of executing process */ -EXTERN uid_t ksheuid; /* effective uid of shell */ -EXTERN int exstat; /* exit status */ -EXTERN int subst_exstat; /* exit status of last $(..)/`..` */ -EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */ -EXTERN char username[]; /* username for \u prompt expansion */ +extern const char *kshname; /* $0 */ +extern pid_t kshpid; /* $$, shell pid */ +extern pid_t procpid; /* pid of executing process */ +extern uid_t ksheuid; /* effective uid of shell */ +extern int exstat; /* exit status */ +extern int subst_exstat; /* exit status of last $(..)/`..` */ +extern const char *safe_prompt; /* safe prompt if PS1 substitution fails */ +extern char username[]; /* username for \u prompt expansion */ /* * Area-based allocation built on malloc/free -- 2.20.1