[lxc-devel] [PATCH 5/7] coverity: Don't store fgets return value if we don't use it

Serge Hallyn serge.hallyn at ubuntu.com
Wed Feb 12 21:59:36 UTC 2014


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/conf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index cd40247..8eccd36 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -1151,7 +1151,7 @@ static int mount_check_fs( const char *dir, char *fstype )
>  	f = fopen("/proc/self/mounts", "r");
>  	if (!f)
>  		return 0;
> -	while ((p = fgets(buf, LINELEN, f))) {
> +	while (fgets(buf, LINELEN, f)) {
>  		p = index(buf, ' ');
>  		if( !p )
>  			continue;
> @@ -1444,7 +1444,7 @@ int detect_shared_rootfs(void)
>  	f = fopen("/proc/self/mountinfo", "r");
>  	if (!f)
>  		return 0;
> -	while ((p = fgets(buf, LINELEN, f))) {
> +	while (fgets(buf, LINELEN, f)) {
>  		for (p = buf, i=0; p && i < 4; i++)
>  			p = index(p+1, ' ');
>  		if (!p)
> -- 
> 1.9.rc1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list