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

S.Çağlar Onur caglar at 10ur.org
Fri Nov 15 05:33:54 UTC 2013


Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
---
 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





More information about the lxc-devel mailing list