mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-10-30 22:27:24 +01:00 
			
		
		
		
	Fix virsh compiler server forking issues
This commit is contained in:
		
							parent
							
								
									dfa6c4a9e1
								
							
						
					
					
						commit
						2361436d34
					
				| @ -49,15 +49,19 @@ sub execute { | ||||
| 
 | ||||
|   print "execute($cmdline)\n"; | ||||
| 
 | ||||
|   my @list = split / /, $cmdline; | ||||
| 
 | ||||
|   my ($ret, $result); | ||||
| 
 | ||||
|   $SIG{CHLD} = 'IGNORE'; | ||||
| 
 | ||||
|   my $child = fork; | ||||
| 
 | ||||
|   if($child == 0) { | ||||
|     ($ret, $result) = eval { | ||||
|       my $result = ''; | ||||
| 
 | ||||
|       my $pid = open(my $fh, '-|', "$cmdline 2>&1"); | ||||
|       my $pid = open(my $fh, '-|', @list); | ||||
| 
 | ||||
|       local $SIG{ALRM} = sub { print "Time out\n"; kill 9, $pid; print "sent KILL to $pid\n"; die "Timed-out: $result\n"; }; | ||||
|       alarm($COMPILE_TIMEOUT); | ||||
| @ -206,7 +210,7 @@ sub compiler_server { | ||||
|               print "Attempting compile...\n"; | ||||
|               alarm 0; | ||||
| 
 | ||||
|               my ($ret, $result) = execute("./compiler_vm_client.pl \Q$lang\E \Q$nick\E \Q$channel\E \Q$code\E"); | ||||
|               my ($ret, $result) = execute("perl compiler_vm_client.pl $lang $nick $channel $code"); | ||||
| 
 | ||||
|               if(not defined $ret) { | ||||
|                 #print "parent continued\n"; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Pragmatic Software
						Pragmatic Software