scripts: mkhash fix return code handling
If hashing a file fails mkhash shouldn't just silently fail. Now check after each call of `hash_file()` the return and exit early in case of errors. The return value which was previously ignored and would always return 0. Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
		
				
					committed by
					
						
						Daniel Golle
					
				
			
			
				
	
			
			
			
						parent
						
							91a0dc5161
						
					
				
				
					commit
					fac98f1c54
				
			@@ -823,8 +823,11 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	if (argc < 2)
 | 
						if (argc < 2)
 | 
				
			||||||
		return hash_file(t, NULL, add_filename);
 | 
							return hash_file(t, NULL, add_filename);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < argc - 1; i++)
 | 
						for (i = 0; i < argc - 1; i++) {
 | 
				
			||||||
		hash_file(t, argv[1 + i], add_filename);
 | 
							int ret = hash_file(t, argv[1 + i], add_filename);
 | 
				
			||||||
 | 
							if (ret)
 | 
				
			||||||
 | 
								return ret;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user