xl2tpd: refactor for more resilience.
[feed/packages.git] / net / xl2tpd / patches / 209-xl2tpd-ignore-SIGPIPE-signal.patch
1 From 2d0eff7f56936823d784425d2171be295ba11027 Mon Sep 17 00:00:00 2001
2 From: Yousong Zhou <yszhou4tech@gmail.com>
3 Date: Fri, 15 May 2015 15:55:10 +0800
4 Subject: [PATCH 209/210] xl2tpd: ignore SIGPIPE signal.
5
6 ---
7 xl2tpd.c | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
9
10 diff --git a/xl2tpd.c b/xl2tpd.c
11 index c11fe66..58ed868 100644
12 --- a/xl2tpd.c
13 +++ b/xl2tpd.c
14 @@ -1551,7 +1551,6 @@ void do_control ()
15 /*FIXME: check quotes to allow filenames with spaces?
16 (do not forget quotes escaping to allow filenames with quotes)*/
17
18 - /*FIXME: write to res_filename may cause SIGPIPE, need to catch it*/
19 resf = fopen (res_filename, "w");
20 if (!resf) {
21 l2tp_log (LOG_DEBUG, "%s: Can't open result file %s\n",
22 @@ -1811,6 +1810,7 @@ void init (int argc,char *argv[])
23 signal (SIGCHLD, &sigchld_handler);
24 signal (SIGUSR1, &sigusr1_handler);
25 signal (SIGHUP, &sighup_handler);
26 + signal (SIGPIPE, SIG_IGN);
27 init_scheduler ();
28
29 unlink(gconfig.controlfile);
30 --
31 1.7.10.4
32