widl [1/2]: Improve file cleanup when errors occur

Alexandre Julliard julliard at winehq.org
Wed Oct 17 07:22:43 CDT 2007


Dan Hipschman <dsh at linux.ucla.edu> writes:

> @@ -446,10 +441,18 @@ static void rm_tempfile(void)
>    abort_import();
>    if(temp_name)
>      unlink(temp_name);
> -  if (header_name)
> -    unlink(header_name);
> -  if (client_name)
> -    unlink(client_name);
> -  if (server_name)
> -    unlink(server_name);
> +  if (nerrors) {
> +    if (do_header)
> +      unlink(header_name);
> +    if (do_client)
> +      unlink(client_name);
> +    if (do_server)
> +      unlink(server_name);
> +    if (do_idfile)
> +      unlink(idfile_name);
> +    if (do_proxies)
> +      unlink(proxy_name);
> +    if (do_typelib)
> +      unlink(typelib_name);
> +  }

This will break cleanup on signals. I think it's better to always
remove the files instead of relying on the error count being set
correctly.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list