On Thu, Apr 23, 2015 at 12:51:33PM -0400, Dan Merillat wrote:
> +/* returns:
> + *  0 if the file exists and should be skipped.
> + *  1 if the file does NOT exist
> + *  2 if the file exists but is OK to overwrite
> + */
> +
> +static int overwrite_ok(const char * path)
> +{
> +     static int warn = 0;
> +     struct stat st;
> +     int ret;
> +
> +     /* don't be fooled by symlinks */
> +     ret = fstatat(-1, path_name, &st, AT_SYMLINK_NOFOLLOW);

Is the filedescriptor -1 correct? Previously, stat was used that uses
AT_FDCWD for the dirfd, which is -100. -1 could be intepreted as a bad
filedescriptor (EBADF).
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to