From 083433aa15e1d093c5b3fb3c5729ca4fc84c3a6f Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 17 May 2016 23:17:51 +0200 Subject: [PATCH] fix wrong usage of file access header (fcntl.h) - should fix issue #22 - add example to test file creation via fopen --- hermit/usr/newlib | 2 +- hermit/usr/tests/hello.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hermit/usr/newlib b/hermit/usr/newlib index c39127d50..b5831ed88 160000 --- a/hermit/usr/newlib +++ b/hermit/usr/newlib @@ -1 +1 @@ -Subproject commit c39127d509503f83412474d5e728c143d5724526 +Subproject commit b5831ed885b5465c2f89c1b5d82428ce2fa3375e diff --git a/hermit/usr/tests/hello.c b/hermit/usr/tests/hello.c index ff87dfb80..353b3f7e6 100644 --- a/hermit/usr/tests/hello.c +++ b/hermit/usr/tests/hello.c @@ -52,7 +52,14 @@ int main(int argc, char** argv) fscanf(file, "%s", fname); printf("Hostname: %s\n", fname); fclose(file); - } + } else fprintf(stderr, "Unable to open file /etc/hostname\n"); + + file = fopen("/tmp/test.txt", "w"); + if (file) + { + fprintf(file, "Hello World!!!\n"); + fclose(file); + } else fprintf(stderr, "Unable to open file /tmp/test.txt\n"); return errno; }