truncate: use O_WRONLY|O_NONBLOCK
This matches coreutils behavior. We don't read the fd, and truncation does not need blocking. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
		@@ -40,7 +40,7 @@ int truncate_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 | 
			
		||||
int truncate_main(int argc UNUSED_PARAM, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	unsigned opts;
 | 
			
		||||
	int flags = O_RDWR;
 | 
			
		||||
	int flags = O_WRONLY | O_NONBLOCK;
 | 
			
		||||
	int ret = EXIT_SUCCESS;
 | 
			
		||||
	char *size_str;
 | 
			
		||||
	off_t size;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user