From 542f6301e92fcdce00ee1acb5a4911fde99e64f4 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Sat, 25 Oct 2014 16:26:07 -0400 Subject: [PATCH] fix: incorrect test of open return value Signed-off-by: John Johansen Acked-by: Steve Beattie --- parser/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/network.c b/parser/network.c index 7ca47241d..6532d3105 100644 --- a/parser/network.c +++ b/parser/network.c @@ -164,7 +164,7 @@ static size_t kernel_af_max(void) { return net_af_max_override; fd = open(PROC_VERSION, O_RDONLY); - if (!fd) + if (fd == -1) /* fall back to default provided during build */ return 0; res = read(fd, &buffer, sizeof(buffer) - 1);