瀏覽代碼

SIGPIPE is ignored now; under some unclear circumstances,
use of exec raised the signal, which then terminated ser;
I'm not aware of any SIGPIPE customers, so it should be ok

Jiri Kuthan 23 年之前
父節點
當前提交
c082a4372f
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      main.c

+ 9 - 2
main.c

@@ -440,14 +440,21 @@ void handle_sigs()
 
 	switch(sig_flag){
 		case 0: break; /* do nothing*/
-		case SIGINT:
 		case SIGPIPE:
+				/* SIGPIPE might be rarely received on use of
+				   exec module; simply ignore it
+				 */
+				LOG(L_WARN, "WARNING: SIGPIPE received and ignored\n");
+				break;
+		case SIGINT:
 		case SIGTERM:
 			/* we end the program in all these cases */
 			if (sig_flag==SIGINT)
 				DBG("INT received, program terminates\n");
-			else if (sig_flag==SIGPIPE)
+#ifdef OBSOLETED
+			else if (sig_flag==SIGPIPE) 
 				DBG("SIGPIPE received, program terminates\n");
+#endif
 			else
 				DBG("SIGTERM received, program terminates\n");