Browse Source

Bugfix compilation too late pipes closing

Yann Weber 1 year ago
parent
commit
d8c833080f
1 changed files with 4 additions and 5 deletions
  1. 4
    5
      compile.c

+ 4
- 5
compile.c View File

226
 	}
226
 	}
227
 	close(ctx->child.pipe_stdin);
227
 	close(ctx->child.pipe_stdin);
228
 
228
 
229
-	FD_ZERO(&sigset);
230
-	FD_SET(sigfd, &sigset);
231
 
229
 
232
 	stimeout = ctx->ctimeout;
230
 	stimeout = ctx->ctimeout;
233
 	do
231
 	do
234
 	{
232
 	{
233
+		FD_ZERO(&sigset);
234
+		FD_SET(sigfd, &sigset);
235
 		if(select(sigfd+1, &sigset, NULL, NULL, &ctx->ctimeout) == 0)
235
 		if(select(sigfd+1, &sigset, NULL, NULL, &ctx->ctimeout) == 0)
236
 		{
236
 		{
237
 			//compilation timeout t_t
237
 			//compilation timeout t_t
277
 		goto err;
277
 		goto err;
278
 	}
278
 	}
279
 
279
 
280
+	close(ctx->child.pipe_stdout[0]);
281
+	close(ctx->child.pipe_stdout[1]);
280
 	ctx->child.pid = 0;
282
 	ctx->child.pid = 0;
281
 	if(ctx->pre_spawn && asmsh_asmc_spawn(ctx) == -1)
283
 	if(ctx->pre_spawn && asmsh_asmc_spawn(ctx) == -1)
282
 	{
284
 	{
284
 		perror("Unable to pre-spawn");
286
 		perror("Unable to pre-spawn");
285
 		goto err;
287
 		goto err;
286
 	}
288
 	}
287
-	
288
-	close(ctx->child.pipe_stdout[0]);
289
-	close(ctx->child.pipe_stdout[1]);
290
 
289
 
291
 	return asmh_asmc_bytecode_from_obj(ctx->respath, res);
290
 	return asmh_asmc_bytecode_from_obj(ctx->respath, res);
292
 
291
 

Loading…
Cancel
Save