diff options
author | Graham Percival <gperciva@tarsnap.com> | 2016-09-26 12:50:29 -0700 |
---|---|---|
committer | Graham Percival <gperciva@tarsnap.com> | 2016-09-26 12:50:29 -0700 |
commit | 2623110256c183f88b616451a8258fcb6e8b06ad (patch) | |
tree | 00cf55e35d7007e03919d516bffcdb98c58166bf /cpio | |
parent | 0f14b0816b2422bd4478e68610a4b6c67f9f68e1 (diff) | |
download | libarchive-2623110256c183f88b616451a8258fcb6e8b06ad.tar.gz |
Add chmod() after make_{dir,file} in test suites
This is the same change that
38b3f516df865e2dffd0a1bbc9feb923ab2efc38
made to
libarchive/test/main.c
, but now applied to:
cat/test/main.c
cpio/test/main.c
tar/test/main.c
Sponsored by: Tarsnap Backup Inc.
Diffstat (limited to 'cpio')
-rw-r--r-- | cpio/test/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpio/test/main.c b/cpio/test/main.c index 985a959b..29bbc37a 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -1605,8 +1605,10 @@ assertion_make_dir(const char *file, int line, const char *dirname, int mode) return (1); #else if (0 == mkdir(dirname, mode)) { - assertion_file_mode(file, line, dirname, mode); - return (1); + if (0 == chmod(dirname, mode)) { + assertion_file_mode(file, line, dirname, mode); + return (1); + } } #endif failure_start(file, line, "Could not create directory %s", dirname); @@ -1656,6 +1658,11 @@ assertion_make_file(const char *file, int line, failure_finish(NULL); return (0); } + if (0 != chmod(path, mode)) { + failure_start(file, line, "Could not chmod %s", path); + failure_finish(NULL); + return (0); + } if (contents != NULL) { ssize_t wsize; |