Check return value of pclose()
This commit is contained in:
		
				
					committed by
					
						
						Aaron Marcher
					
				
			
			
				
	
			
			
			
						parent
						
							c12b9cc50b
						
					
				
				
					commit
					b640cc489b
				
			@@ -16,7 +16,10 @@ run_command(const char *cmd)
 | 
				
			|||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	p = fgets(buf, sizeof(buf) - 1, fp);
 | 
						p = fgets(buf, sizeof(buf) - 1, fp);
 | 
				
			||||||
	pclose(fp);
 | 
						if (pclose(fp) < 0) {
 | 
				
			||||||
 | 
							warn("pclose '%s':", cmd);
 | 
				
			||||||
 | 
							return NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if (!p) {
 | 
						if (!p) {
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user