forked from epics_driver_modules/require
fixes for vxWorks 6
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+19
-2
@@ -8,10 +8,16 @@
|
||||
#include <epicsVersion.h>
|
||||
|
||||
#ifdef vxWorks
|
||||
extern int execute(const char*);
|
||||
#include "asprintf.h"
|
||||
#ifdef _WRS_VXWORKS_MAJOR
|
||||
/* vxWorks 6+ */
|
||||
#include <private/shellLibP.h>
|
||||
#else
|
||||
/* vxWorks 5 */
|
||||
#include <shellLib.h>
|
||||
#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);
|
||||
|
||||
Reference in New Issue
Block a user