MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_flopen_create

Function test_flopen_create

tools/libutil/tests/flopen_test.c:47–63  ·  view source on GitHub ↗

* Test that flopen() can create a file. */

Source from the content-addressed store, hash-verified

45 * Test that flopen() can create a file.
46 */
47const char *
48test_flopen_create(void)
49{
50 const char *fn = "test_flopen_create";
51 const char *result = NULL;
52 int fd;
53
54 unlink(fn);
55 fd = flopen(fn, O_RDWR|O_CREAT, 0640);
56 if (fd < 0) {
57 result = strerror(errno);
58 } else {
59 close(fd);
60 }
61 unlink(fn);
62 return (result);
63}
64
65/*
66 * Test that flopen() can open an existing file.

Callers

nothing calls this directly

Calls 2

flopenFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected