1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

fix wrong usage of file access header (fcntl.h)

- should fix issue #22
- add example to test file creation via fopen
This commit is contained in:
Stefan Lankes 2016-05-17 23:17:51 +02:00
parent 8932e05ad7
commit 083433aa15
2 changed files with 9 additions and 2 deletions

@ -1 +1 @@
Subproject commit c39127d509503f83412474d5e728c143d5724526
Subproject commit b5831ed885b5465c2f89c1b5d82428ce2fa3375e

View file

@ -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;
}