mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2026-03-20 00:30:59 +03:00
remove bug with sockets: write->send(..., MSG_NOSIGNAL)
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user