Re: [PATCH] Btrfs-progs: fix closing of opendir()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> --- a/utils.c
> +++ b/utils.c
> @@ -1476,11 +1475,11 @@ u64 parse_size(char *s)
>  	return strtoull(s, NULL, 10) * mult;
>  }
>  
> -int open_file_or_dir(const char *fname)
> +int open_file_or_dir(const char *fname, DIR **dirstream)
>  {
>  	int ret;
>  	struct stat st;
> -	DIR *dirstream = NULL;
> +	*dirstream = NULL;

This is imho not needed, all call sites explicitly set dirstream to NULL
which is more clear than hiding it inside a function as a sideefect, so
I'll drop that line.

>  	int fd;
>  
>  	ret = stat(fname, &st);
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux