--- src/shl.c.orig 2005-11-08 23:43:31.000000000 -0600 +++ src/shl.c 2023-07-30 02:32:31.000000000 -0500 @@ -36,6 +36,7 @@ static const char id[]="$Id: shl.c,v 1.2 #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ /* boot_tmp is a init hack to support initialization of UT subsystems (such as * mem) which need to register shl cmds prior to shl's own initialization. */ static UT_shl_cmd boot_tmp_cmds[NUM_BOOT_TMP_CMDS]; -static boot_tmp_idx=0; +static int boot_tmp_idx=0; static UT_shl_lang_glue glues[] = {GLUES}; @@ -456,7 +457,7 @@ int UT_shl_port_cb(int fd, char *name, i if (fcntl(fd,F_SETFD,fg) == -1) UT_LOG(Error,"fcntl setfd failed"); } else UT_LOG(Error, "fcntl getfd failed"); - return; + return 0; } LL_FIND_BY_MEMBER(UT_shl_global.sessions,session,fd,fd); @@ -475,7 +476,7 @@ int UT_shl_port_cb(int fd, char *name, i in = session->in; - if (rc == -1 && errno == EINTR) return; + if (rc == -1 && errno == EINTR) return 0; else if (rc == -1) errsts = strerror(errno); else if (rc == 0) errsts = "remote close"; else if (UT_iob_len(in) + rc >= SHL_PORT_MAX_INPUT) errsts = "flooded"; @@ -483,12 +484,12 @@ int UT_shl_port_cb(int fd, char *name, i if (errsts) { UT_LOG(Info,"shl port connection closed (%s)", errsts); UT_shl_close_session(session); - return; + return -1; } if (!found_eol) { UT_iob_append(in,input,rc); - return; + return 0; } /* Concatenate buffer with current input, if needed. */ @@ -523,6 +524,7 @@ int UT_shl_port_cb(int fd, char *name, i } if (cmdtxt) free(cmdtxt); + return 0; } /*******************************************************************************