[lxc-devel] [PATCH] p is a pointer and cannot be negative so check if it is NULL

Serge Hallyn serge.hallyn at ubuntu.com
Mon Nov 18 15:37:14 UTC 2013


Quoting S.Çağlar Onur (caglar at 10ur.org):
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>

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

> ---
>  src/lxc/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/utils.c b/src/lxc/utils.c
> index 3fab9ae..e2d2639 100644
> --- a/src/lxc/utils.c
> +++ b/src/lxc/utils.c
> @@ -483,7 +483,7 @@ int sha1sum_file(char *fnam, unsigned char *digest)
>  	process_lock();
>  	f = fopen_cloexec(fnam, "r");
>  	process_unlock();
> -	if (f < 0) {
> +	if (!f) {
>  		SYSERROR("Error opening template");
>  		return -1;
>  	}
> -- 
> 1.8.3.2
> 
> 
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list