X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-fileio.c;h=1de59fa573634d361341956fc4a24358fbac2b43;hb=2d2349cc3ed43153344807892332c9fa626c8d8a;hp=eb4fbc91d2dcd2dc50463185ccc99d78c78ca1fd;hpb=5fba7bbfa47ef5c03a28000252d06ec82405d461;p=elogind.git diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index eb4fbc91d..1de59fa57 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -41,11 +41,11 @@ static void test_parse_env_file(void) { char **i; unsigned k; - fd = mkstemp(p); + fd = mkostemp_safe(p, O_RDWR|O_CLOEXEC); assert_se(fd >= 0); close(fd); - fd = mkostemp(t, O_CLOEXEC); + fd = mkostemp_safe(t, O_RDWR|O_CLOEXEC); assert_se(fd >= 0); f = fdopen(fd, "w"); @@ -72,7 +72,7 @@ static void test_parse_env_file(void) { fflush(f); fclose(f); - r = load_env_file(t, NULL, &a); + r = load_env_file(NULL, t, NULL, &a); assert_se(r >= 0); STRV_FOREACH(i, a) @@ -139,7 +139,7 @@ static void test_parse_env_file(void) { r = write_env_file(p, a); assert_se(r >= 0); - r = load_env_file(p, NULL, &b); + r = load_env_file(NULL, p, NULL, &b); assert_se(r >= 0); unlink(t); @@ -154,11 +154,11 @@ static void test_parse_multiline_env_file(void) { _cleanup_strv_free_ char **a = NULL, **b = NULL; char **i; - fd = mkstemp(p); + fd = mkostemp_safe(p, O_RDWR|O_CLOEXEC); assert_se(fd >= 0); close(fd); - fd = mkostemp(t, O_CLOEXEC); + fd = mkostemp_safe(t, O_RDWR|O_CLOEXEC); assert_se(fd >= 0); f = fdopen(fd, "w"); @@ -179,7 +179,7 @@ static void test_parse_multiline_env_file(void) { fflush(f); fclose(f); - r = load_env_file(t, NULL, &a); + r = load_env_file(NULL, t, NULL, &a); assert_se(r >= 0); STRV_FOREACH(i, a) @@ -193,7 +193,7 @@ static void test_parse_multiline_env_file(void) { r = write_env_file(p, a); assert_se(r >= 0); - r = load_env_file(p, NULL, &b); + r = load_env_file(NULL, p, NULL, &b); assert_se(r >= 0); unlink(t); @@ -207,7 +207,7 @@ static void test_executable_is_script(void) { FILE *f; char *command; - fd = mkostemp(t, O_CLOEXEC); + fd = mkostemp_safe(t, O_RDWR|O_CLOEXEC); assert_se(fd >= 0); f = fdopen(fd, "w");