ignore SIGPIPE
this prevents a crash on clients improperly closing sockets
This commit is contained in:
parent
d968844f65
commit
0df4eebd91
1 changed files with 3 additions and 0 deletions
3
fbflut.c
3
fbflut.c
|
@ -7,6 +7,7 @@
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
#include <sys/signal.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@ -95,6 +96,8 @@ void *handle_connection(void *socket_desc) {
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
port = argc > 1 ? atoi(argv[1]) : 0;
|
port = argc > 1 ? atoi(argv[1]) : 0;
|
||||||
if (!port)
|
if (!port)
|
||||||
port = 1234;
|
port = 1234;
|
||||||
|
|
Loading…
Reference in a new issue