This patch fixes the emcrsh shutdown command. Now issuing a shutdown
command will make emcrsh exit.
Just for completeness it also adds "SHUTDOWN NAK" if you try to shut
down without enabling control functions.
Les
Index: emcrsh.cc
===================================================================
RCS file: /cvs/emc2/src/emc/usr_intf/emcrsh.cc,v
retrieving revision 1.13
diff -u -p -r1.13 emcrsh.cc
--- emcrsh.cc 23 Dec 2008 15:48:23 -0000 1.13
+++ emcrsh.cc 28 Dec 2008 09:13:40 -0000
@@ -2374,7 +2374,6 @@ int commandShutdown(connectionRecType *c
if (context->cliSock == enabledConn) {
printf("Shutting down\n");
thisQuit();
- exit(0);
return -1;
}
else
@@ -2598,6 +2597,7 @@ int parseCommand(connectionRecType *cont
char *pch;
char s[64];
static char *helloNakStr = "HELLO NAK\r\n";
+ static char *shutdownNakStr = "SHUTDOWN NAK\r\n";
static char *helloAckStr = "HELLO ACK %s 1.1\r\n";
static char *setNakStr = "SET NAK\r\n";
@@ -2624,6 +2624,9 @@ int parseCommand(connectionRecType *cont
break;
case cmdShutdown:
ret = commandShutdown(context);
+ if(ret ==0){
+ write(context->cliSock, shutdownNakStr, strlen(shutdownNakStr));
+ }
break;
case cmdHelp:
ret = commandHelp(context);
------------------------------------------------------------------------------
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers