remove bug with sockets: write->send(..., MSG_NOSIGNAL)

This commit is contained in:
2022-03-24 12:16:41 +03:00
parent 76a1ec0e81
commit 9a06693673
6 changed files with 9 additions and 9 deletions

View File

@@ -123,7 +123,7 @@ void sendmessage(int fd, const char *msg, int l){
char *tmpbuf = MALLOC(char, l+1);
memcpy(tmpbuf, msg, l);
if(msg[l-1] != '\n') tmpbuf[l++] = '\n';
if(l != write(fd, tmpbuf, l)){
if(l != send(fd, tmpbuf, l, MSG_NOSIGNAL)){
LOGWARN("write()");
WARN("write()");
}else{