aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/Runtime/POSIX
diff options
context:
space:
mode:
authorMorgan Jones <me@numin.it>2022-01-28 21:23:14 -0700
committerCristian Cadar <c.cadar@imperial.ac.uk>2022-03-11 14:01:37 +0100
commit043f43fd03f06fbd332d16a24bb9f6b58ee66aef (patch)
tree7d8fcaa59e319dfa651d08247be5afd746483f4d /test/Runtime/POSIX
parentec81fd165883cf0d033e7822c39c6b6c33f57d77 (diff)
downloadklee-043f43fd03f06fbd332d16a24bb9f6b58ee66aef.tar.gz
FD_Fail: use /dev/zero instead of /etc/mtab
/etc/mtab doesn't exist in the Nix build sandbox since /etc doesn't exist. However, /dev/zero is more common on UNIX systems and does.
Diffstat (limited to 'test/Runtime/POSIX')
-rw-r--r--test/Runtime/POSIX/FD_Fail.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/Runtime/POSIX/FD_Fail.c b/test/Runtime/POSIX/FD_Fail.c
index 8d205859..1ab0f18c 100644
--- a/test/Runtime/POSIX/FD_Fail.c
+++ b/test/Runtime/POSIX/FD_Fail.c
@@ -6,18 +6,18 @@
#include <assert.h>
int main(int argc, char** argv) {
- char buf[1024];
- FILE* f = fopen("/etc/mtab", "r");
+ char buf[1024];
+ FILE* f = fopen("/dev/zero", "rb");
assert(f);
-
+
int r = fread(buf, 1, 100, f);
- printf("fread(): %s\n",
+ printf("fread(): %s\n",
r ? "ok" : "fail");
// CHECK-DAG: fread(): ok
// CHECK-DAG: fread(): fail
r = fclose(f);
- printf("fclose(): %s\n",
+ printf("fclose(): %s\n",
r ? "ok" : "fail");
// CHECK-DAG: fclose(): ok
// CHECK-DAG: fclose(): fail