[CRIU] [PATCH] posix-timers: don't call ferror for NULL

Pavel Emelyanov xemul at parallels.com
Tue Jul 2 09:25:33 EDT 2013


On 07/02/2013 07:23 PM, Andrey Vagin wrote:
> parse_posix_timers should not call ferror if fopen returned NULL.
> 
> Reported-by: Adrian Reber <adrian at lisas.de>
> Cc: Pavel Tikhomirov <snorcht at gmail.com>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  proc_parse.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/proc_parse.c b/proc_parse.c
> index 7115392..28e2983 100644
> --- a/proc_parse.c
> +++ b/proc_parse.c
> @@ -1190,8 +1190,7 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args)
>  	file = fopen_proc(pid, "timers");
>  	if (file == NULL) {
>  		pr_perror("Can't open posix timers file!");
> -		ret = -1;
> -		goto end_posix;
> +		return -1;
>  	}
>  
>  	while (1) {
> 

Applied


More information about the CRIU mailing list