Path: blob/main/sys/contrib/zstd/zlibWrapper/gzclose.c
48254 views
/* gzclose.c contains minimal changes required to be compiled with zlibWrapper:1* - gz_statep was converted to union to work with -Wstrict-aliasing=1 */23/* gzclose.c -- zlib gzclose() function4* Copyright (C) 2004, 2010 Mark Adler5* For conditions of distribution and use, see http://www.zlib.net/zlib_license.html6*/78#include "gzguts.h"910/* gzclose() is in a separate file so that it is linked in only if it is used.11That way the other gzclose functions can be used instead to avoid linking in12unneeded compression or decompression routines. */13int ZEXPORT gzclose(file)14gzFile file;15{16#ifndef NO_GZCOMPRESS17gz_statep state;1819if (file == NULL)20return Z_STREAM_ERROR;21state.file = file;2223return state.state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);24#else25return gzclose_r(file);26#endif27}282930