mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Don't die on SIGPIPE
This commit is contained in:
parent
07dbb9c4f9
commit
2603aacf1f
1 changed files with 2 additions and 0 deletions
2
main.cc
2
main.cc
|
@ -4,6 +4,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -22,6 +23,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
srandom(time(NULL));
|
srandom(time(NULL));
|
||||||
|
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
int lfd = socket(AF_INET, SOCK_STREAM, 0);
|
int lfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue