test-resolved: fix error code check in assertion

If file "/etc/hosts" does not exist, fopen fails and sets errno to ENOENT
("No such file or directory"). So errno should be compared with ENOENT.

This mistake causes test test-resolved-etc-hosts to fail when run on Debian
image built with mkosi.debian included in the repo. The image does not include
"/etc/hosts" file as it is not created by debootstrap, see debootstrap manpage
https://manpages.debian.org/stretch/debootstrap/debootstrap.8.en.html.
This commit is contained in:
Alexey Bogdanenko
2018-12-06 17:23:05 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 871fa294ff
commit 487e33242f
+1 -1
View File
@@ -11,7 +11,7 @@ static void test_parse_etc_hosts_system(void) {
f = fopen("/etc/hosts", "re");
if (!f) {
assert_se(errno == -ENOENT);
assert_se(errno == ENOENT);
return;
}