Merge pull request #10536 from keszybz/serialize-fixes

Tests for the new serialization functions
This commit is contained in:
Lennart Poettering
2018-10-26 17:56:43 +02:00
committed by GitHub
10 changed files with 265 additions and 130 deletions
+18
View File
@@ -1221,6 +1221,24 @@ int mkostemp_safe(char *pattern) {
return fd;
}
int fmkostemp_safe(char *pattern, const char *mode, FILE **ret_f) {
int fd;
FILE *f;
fd = mkostemp_safe(pattern);
if (fd < 0)
return fd;
f = fdopen(fd, mode);
if (!f) {
safe_close(fd);
return -errno;
}
*ret_f = f;
return 0;
}
int tempfn_xxxxxx(const char *p, const char *extra, char **ret) {
const char *fn;
char *t;
+1
View File
@@ -64,6 +64,7 @@ int fflush_sync_and_check(FILE *f);
int fopen_temporary(const char *path, FILE **_f, char **_temp_path);
int mkostemp_safe(char *pattern);
int fmkostemp_safe(char *pattern, const char *mode, FILE**_f);
int tempfn_xxxxxx(const char *p, const char *extra, char **ret);
int tempfn_random(const char *p, const char *extra, char **ret);