summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/yaml-parser.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp
index e75f8fe8..5ff4c323 100644
--- a/test/yaml-parser.cpp
+++ b/test/yaml-parser.cpp
@@ -49,10 +49,11 @@ protected:
if (fd == -1)
return false;
- FILE *fh = fdopen(fd, "w");
- fputs(content.c_str(), fh);
+ int ret = write(fd, content.c_str(), content.size());
+ close(fd);
- fclose(fh);
+ if (ret != static_cast<int>(content.size()))
+ return false;
return true;
}