diff --git a/tecs/coc_client.c b/tecs/coc_client.c index c758c176..9189ffd4 100644 --- a/tecs/coc_client.c +++ b/tecs/coc_client.c @@ -124,10 +124,8 @@ int CocTryCmd(CocConn *conn) { } ERR_SI(send(conn->fd, conn->cmdbuf->buf, conn->cmdbuf->wrpos, 0)); ERR_I(CocRecv(conn->fd, conn->resbuf)); - signal(SIGPIPE, SIG_DFL); return(0); OnError: - signal(SIGPIPE, SIG_DFL); if (ErrCode==ECONNRESET || ErrCode==EPIPE) return(-2); return(iret); } diff --git a/tecs/tecs.c b/tecs/tecs.c index 09ec967b..cb0710af 100644 --- a/tecs/tecs.c +++ b/tecs/tecs.c @@ -660,7 +660,7 @@ int SetTemp(int switchOn) { ERR_P(LscCmd(ser, "CSET 1:[chan],1,1,0;RANGE:0;SETP 1:0")); } else if (remoteMode==1) { /* in local mode: do not switch on heater */ ERR_P(LscCmd(ser, "SETP 1:[tempH]")); - } else if (switchOn) { + } else if (switchOn || (htrst>=5 && relay==0)) { /* switch on also when bad heater message and no alarms */ ERR_P(LscCmd(ser, "CSET 1:[chan],1,1,0;RANGE:[iRange];SETP 1:[tempH]")); } else { ERR_P(LscCmd(ser, "CSET 1:[chan],1;SETP 1:[tempH]"));