aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/test/test_read_set_format.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libarchive/libarchive/test/test_read_set_format.c')
-rw-r--r--contrib/libarchive/libarchive/test/test_read_set_format.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/libarchive/libarchive/test/test_read_set_format.c b/contrib/libarchive/libarchive/test/test_read_set_format.c
index fb5e0047443a..b4f414fa2bb2 100644
--- a/contrib/libarchive/libarchive/test/test_read_set_format.c
+++ b/contrib/libarchive/libarchive/test/test_read_set_format.c
@@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
/* bunzip2 will write to stderr, redirect it to a file */
fflush(stderr);
fgetpos(stderr, &pos);
- fd = dup(fileno(stderr));
- fp = freopen("stderr1", "w", stderr);
+ assert((fd = dup(fileno(stderr))) != -1);
+ fp = freopen("stderr1", "w", stderr);
#endif
assert((a = archive_read_new()) != NULL);
@@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
if (fp != NULL) {
fflush(stderr);
dup2(fd, fileno(stderr));
- close(fd);
clearerr(stderr);
- fsetpos(stderr, &pos);
+ (void)fsetpos(stderr, &pos);
}
+ close(fd);
assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
#endif
}