瀏覽代碼

Note that the SIGCHLD handler could be re-entered.

tags/v0.9.3
Michael Brown 17 年之前
父節點
當前提交
b6194b8cb9
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7
    1
      src/core/resolv.c

+ 7
- 1
src/core/resolv.c 查看文件

@@ -103,8 +103,14 @@ static void resolv_sigchld ( struct async *async,
103 103
 		container_of ( async, struct resolution, async );
104 104
 	int rc;
105 105
 
106
-	/* If this child succeeded, kill all the others and return */
106
+	/* Reap the child */
107 107
 	async_wait ( async, &rc, 1 );
108
+
109
+	/* If this child succeeded, kill all the others and return.
110
+	 * Killing the others means that this routine may be
111
+	 * re-entered; this is safe provided that no child returns a
112
+	 * success exit status when killed by SIGKILL.
113
+	 */
108 114
 	if ( rc == 0 ) {
109 115
 		async_signal_children ( async, SIGKILL );
110 116
 		async_done ( async, 0 );

Loading…
取消
儲存