From 2971a6c3c447f6899adf4c14a481548dabf41a49 Mon Sep 17 00:00:00 2001 From: Roger Cole Date: Sat, 3 Aug 1991 20:17:41 +0000 Subject: [PATCH] always get environment variable --- src/util/cmdProto.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/util/cmdProto.c b/src/util/cmdProto.c index 0de14e2dc..7383c37bd 100644 --- a/src/util/cmdProto.c +++ b/src/util/cmdProto.c @@ -1,4 +1,4 @@ -/* $Id$ +/* share/src/util $Id$ * Author: Roger A. Cole * Date: 10-24-90 * @@ -260,6 +260,13 @@ char *option; /* I NULL, "hostName", or "server" */ { long stat; /* status return from calls */ int serverStart=0; /* 1 says start as server */ + char portText[10]; + + if (envGetConfigParam(&EPICS_CMD_PROTO_PORT, 10, portText) == NULL) { + printf("error getting %s\n", EPICS_CMD_PROTO_PORT.name); + return ERROR; + } + sscanf(portText, "%d", &glZzzIPPort); /*----------------------------------------------------------------------------- * if the option is present and not "server", then run as a client @@ -269,12 +276,6 @@ char *option; /* I NULL, "hostName", or "server" */ #ifdef vxWorks (void)printf("can't operate as client under VxWorks\n"); #else - char portText[10]; - if (envGetConfigParam(&EPICS_CMD_PROTO_PORT, 10, portText) == NULL) { - printf("error getting %s\n", EPICS_CMD_PROTO_PORT.name); - return ERROR; - } - sscanf(portText, "%d", &glZzzIPPort); execl("cmdClient", "cmdClient", option, portText, (char *)0); (void)printf("couldn't exec to cmdClient\n"); #endif