parser BUGFIX fd error value
diff --git a/src/parser.c b/src/parser.c
index ab0acd5..fe8528b 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -187,7 +187,8 @@
     }
 
     fd = open(fp, O_RDONLY);
-    LY_CHECK_ERR_RET(!fd, LOGERR(NULL, LY_ESYS, "Failed to open file \"%s\" (%s).", fp, strerror(errno)); free(fp), LY_ESYS);
+    LY_CHECK_ERR_RET(fd == -1, LOGERR(NULL, LY_ESYS, "Failed to open file \"%s\" (%s).", fp, strerror(errno)); free(fp),
+                     LY_ESYS);
 
     LY_CHECK_ERR_RET(ret = ly_in_new_fd(fd, in), free(fp), ret);