59 lines
2.1 KiB
Diff
59 lines
2.1 KiB
Diff
Index: src/libCom/osi/os/default/epicsReadline.c
|
|
===================================================================
|
|
RCS file: /cvs/G/EPICS/base-3.14.12/src/libCom/osi/os/default/epicsReadline.c,v
|
|
retrieving revision 1.1.1.1
|
|
diff -u -r1.1.1.1 epicsReadline.c
|
|
--- src/libCom/osi/os/default/epicsReadline.c 29 Nov 2010 10:38:07 -0000 1.1.1.1
|
|
+++ src/libCom/osi/os/default/epicsReadline.c 25 Nov 2013 09:50:01 -0000
|
|
@@ -189,8 +189,13 @@
|
|
#include <ledLib.h>
|
|
#define LEDLIB_LINESIZE 1000
|
|
|
|
+#ifndef _WRS_VXWORKS_MAJOR
|
|
+/* vxWorks 5 uses int but vxWorks 6 uses LED_ID */
|
|
+#define LED_ID int
|
|
+#endif
|
|
+
|
|
struct readlineContext {
|
|
- int ledId;
|
|
+ LED_ID ledId;
|
|
char line[LEDLIB_LINESIZE];
|
|
FILE *in;
|
|
};
|
|
@@ -205,7 +210,7 @@
|
|
|
|
readlineContext = malloc(sizeof *readlineContext);
|
|
if (readlineContext != NULL) {
|
|
- readlineContext->ledId = ERROR;
|
|
+ readlineContext->ledId = (LED_ID)ERROR;
|
|
readlineContext->in = in;
|
|
if (in == NULL) {
|
|
long i = 50;
|
|
@@ -213,7 +218,7 @@
|
|
envGetLongConfigParam(&IOCSH_HISTSIZE, &i);
|
|
if (i < 1) i = 1;
|
|
readlineContext->ledId = ledOpen(fileno(stdin), fileno(stdout), i);
|
|
- if (readlineContext->ledId == ERROR) {
|
|
+ if (readlineContext->ledId == (LED_ID)ERROR) {
|
|
readlineContext->in = stdin;
|
|
printf("Warning -- Unabled to allocate space for command-line history.\n");
|
|
printf("Warning -- Command-line editting disabled.\n");
|
|
@@ -236,7 +241,7 @@
|
|
fputs(prompt, stdout);
|
|
fflush(stdout);
|
|
}
|
|
- if (readlineContext->ledId != ERROR) {
|
|
+ if (readlineContext->ledId != (LED_ID)ERROR) {
|
|
i = ledRead(readlineContext->ledId, readlineContext->line, LEDLIB_LINESIZE-1);
|
|
if (i < 0)
|
|
return NULL;
|
|
@@ -262,7 +267,7 @@
|
|
struct readlineContext *readlineContext = context;
|
|
|
|
if (readlineContext) {
|
|
- if (readlineContext->ledId != ERROR)
|
|
+ if (readlineContext->ledId != (LED_ID)ERROR)
|
|
ledClose(readlineContext->ledId);
|
|
free(readlineContext);
|
|
}
|