mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-27 08:00:11 +00:00
Don't override the perfectly good default ->zalloc and ->zfree functions.
This commit is contained in:
parent
00603a0f61
commit
54a3365da2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219094
@ -42,24 +42,6 @@
|
||||
#include "fifolog.h"
|
||||
#include "libfifolog_int.h"
|
||||
|
||||
/*
|
||||
* Memory handling for zlib
|
||||
*/
|
||||
|
||||
static voidpf
|
||||
fifo_zalloc(voidpf opaque __unused, uInt items, uInt size)
|
||||
{
|
||||
|
||||
return calloc(items,size);
|
||||
}
|
||||
|
||||
static void
|
||||
fifo_zfree(voidpf opaque __unused, voidpf address)
|
||||
{
|
||||
|
||||
free(address);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open a fifolog file or partition for reading or writing.
|
||||
*
|
||||
@ -88,6 +70,7 @@ fifolog_int_open_i(struct fifolog_file *f, const char *fname, int mode)
|
||||
|
||||
if (i != 0) {
|
||||
i = fstat(f->fd, &st);
|
||||
assert(i == 0);
|
||||
if (!S_ISREG(st.st_mode))
|
||||
return ("Neither disk nor regular file");
|
||||
f->recsize = 512;
|
||||
@ -145,8 +128,6 @@ fifolog_int_open_i(struct fifolog_file *f, const char *fname, int mode)
|
||||
f->zs = calloc(sizeof *f->zs, 1);
|
||||
if (f->zs == NULL)
|
||||
return ("cannot malloc");
|
||||
f->zs->zalloc = fifo_zalloc;
|
||||
f->zs->zfree = fifo_zfree;
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user