From bd45ac15e94f511043aa0308cabc388ef136ed2d Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 10 Mar 2016 10:29:13 +0100 Subject: [PATCH] fixes for vxWorks 6 --- GNUmakefile | 3 ++- require.c | 3 +++ runScript.c | 21 +++++++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 3a1d26a..564e45c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,7 +9,8 @@ DBDS += runScript.dbd #HEADERS += require.h -SOURCES_vxWorks += strdup.c asprintf.c +SOURCES_T2 += strdup.c +SOURCES_vxWorks += asprintf.c HEADERS += strdup.h asprintf.h # We need to find the Linux link.h before the EPICS link.h diff --git a/require.c b/require.c index 2c1b538..a79accc 100644 --- a/require.c +++ b/require.c @@ -293,10 +293,13 @@ static HMODULE loadlib(const char* libname) { errno = 0; libhandle = loadModule(fd, LOAD_GLOBAL_SYMBOLS); +#ifndef _WRS_VXWORKS_MAJOR +/* vxWorks 5 */ if (errno == S_symLib_SYMBOL_NOT_FOUND) { libhandle = NULL; } +#endif loaderror = errno; close (fd); } diff --git a/runScript.c b/runScript.c index 9a3015e..97be43f 100644 --- a/runScript.c +++ b/runScript.c @@ -8,10 +8,16 @@ #include #ifdef vxWorks -extern int execute(const char*); #include "asprintf.h" +#ifdef _WRS_VXWORKS_MAJOR +/* vxWorks 6+ */ +#include +#else +/* vxWorks 5 */ +#include #include "strdup.h" #endif +#endif #ifdef BASE_VERSION #define EPICS_3_13 @@ -288,7 +294,18 @@ int runScript(const char* filename, const char* args) macPutValue(mac, p, line_raw); continue; } -#ifdef vxWorks +#ifdef _WRS_VXWORKS_MAJOR + if (strlen(line_exp) >= 255) + { + fprintf(stderr, "runScript: Line too long (>=255):\n%s\n", line_exp); + return -1; + } + else + { + SHELL_EVAL_VALUE result; + status = shellInterpEvaluate(line_exp, "C", &result); + } +#elif defined(vxWorks) if (strlen(line_exp) >= 120) { fprintf(stderr, "runScript: Line too long (>=120):\n%s\n", line_exp);