[PATCH 3/7] server: Fail to set delete disposition on a non-empty directory.

Alexandre Julliard julliard at winehq.org
Wed Nov 7 11:38:37 CST 2018


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> +static int is_directory_empty( struct fd *fd )
> +{
> +    DIR *dir;
> +    int count = 0;
> +
> +    if ((dir = fdopendir( fd->unix_fd )))
> +    {
> +        while (readdir( dir ) != NULL && count <= 2)
> +            count++;
> +
> +        closedir( dir );
> +    }

This won't work, closedir() is going to close the file descriptor.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list