summaryrefslogtreecommitdiff
path: root/usr.bin/compress/zopen.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-06-26 18:20:27 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-06-26 18:20:27 +0000
commitfc2e961afee43c42cf0495f4475300b3efddbf6f (patch)
tree6956cd68d43969509611a86fa9d1d5887efd05ff /usr.bin/compress/zopen.c
parentbd1651b67f7df6ae51a80130340147a4d02a2eef (diff)
be a bit more carefull not writing to the stream after the timestamps
have been set. ok deraadt@
Diffstat (limited to 'usr.bin/compress/zopen.c')
-rw-r--r--usr.bin/compress/zopen.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c
index 2f29874b849..10f58c8d164 100644
--- a/usr.bin/compress/zopen.c
+++ b/usr.bin/compress/zopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zopen.c,v 1.15 2005/04/17 16:17:39 deraadt Exp $ */
+/* $OpenBSD: zopen.c,v 1.16 2005/06/26 18:20:26 otto Exp $ */
/* $NetBSD: zopen.c,v 1.5 1995/03/26 09:44:53 glass Exp $ */
/*-
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)zopen.c 8.1 (Berkeley) 6/27/93";
#else
const char z_rcsid[] =
- "$OpenBSD: zopen.c,v 1.15 2005/04/17 16:17:39 deraadt Exp $";
+ "$OpenBSD: zopen.c,v 1.16 2005/06/26 18:20:26 otto Exp $";
#endif
/*-
@@ -313,7 +313,7 @@ nomatch: if (output(zs, (code_int) zs->zs_ent) == -1)
}
int
-z_close(void *cookie, struct z_info *info)
+z_close(void *cookie, struct z_info *info, const char *name, struct stat *sb)
{
struct s_zstate *zs;
int rval;
@@ -341,6 +341,9 @@ z_close(void *cookie, struct z_info *info)
info->total_out = (off_t)zs->zs_bytes_out;
}
+#ifndef SAVECORE
+ setfile(name, zs->zs_fd, sb);
+#endif
rval = close(zs->zs_fd);
free(zs);
return (rval);
@@ -349,7 +352,7 @@ z_close(void *cookie, struct z_info *info)
static int
zclose(void *cookie)
{
- return z_close(cookie, NULL);
+ return z_close(cookie, NULL, NULL, NULL);
}
/*-