summaryrefslogtreecommitdiff
path: root/src/test/test-fileio.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-12-12 00:06:30 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-12-12 02:46:09 +0100
commitd514feaa872820d5cb4e9321ad32673c09fbb3f4 (patch)
tree04caa9838bf139b46a2c4409030132d08eaa24ec /src/test/test-fileio.c
parentd78bf250b0e31b42eb8b86ebe3ee775b247bfcf8 (diff)
test-fileio: replace mktemp with mkstemp to avoid warnings
This is a fairly useless thing to do but it makes the compilers and analyzers shut up about the use of mktemp.
Diffstat (limited to 'src/test/test-fileio.c')
-rw-r--r--src/test/test-fileio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index 06f3e28288..b005f3b4e6 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -41,7 +41,9 @@ static void test_parse_env_file(void) {
char **i;
unsigned k;
- assert_se(mktemp(p));
+ fd = mkstemp(p);
+ assert_se(fd >= 0);
+ close(fd);
fd = mkostemp(t, O_CLOEXEC);
assert_se(fd >= 0);
@@ -152,7 +154,9 @@ static void test_parse_multiline_env_file(void) {
_cleanup_strv_free_ char **a = NULL, **b = NULL;
char **i;
- assert_se(mktemp(p));
+ fd = mkstemp(p);
+ assert_se(fd >= 0);
+ close(fd);
fd = mkostemp(t, O_CLOEXEC);
assert_se(fd >= 0);