dom0/meminfo-writer: fork into background after first info sent to qmemman (#635)
This commit is contained in:
		
							parent
							
								
									41f672a748
								
							
						
					
					
						commit
						49072ce570
					
				| @ -154,6 +154,17 @@ int main(int argc, char **argv) | ||||
| 		perror("xs_domain_open"); | ||||
| 		exit(1); | ||||
| 	} | ||||
| 	if (argc == 3) { | ||||
| 		/* if not waiting for signal, fork after first info written to xenstore */ | ||||
| 		n = pread(fd, buf, sizeof(buf), 0); | ||||
| 		buf[n] = 0; | ||||
| 		meminfo_data = parse(buf); | ||||
| 		if (meminfo_data) | ||||
| 			send_to_qmemman(xs, meminfo_data); | ||||
| 		if (fork() > 0) | ||||
| 			exit(0); | ||||
| 	} | ||||
| 
 | ||||
| 	for (;;) { | ||||
| 		n = pread(fd, buf, sizeof(buf), 0); | ||||
| 		buf[n] = 0; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marek Marczykowski
						Marek Marczykowski