Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2011 08:59:35 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r219094 - head/usr.sbin/fifolog/lib
Message-ID:  <201102280859.p1S8xZ2P031246@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phk
Date: Mon Feb 28 08:59:35 2011
New Revision: 219094
URL: http://svn.freebsd.org/changeset/base/219094

Log:
  Don't override the perfectly good default ->zalloc and ->zfree functions.

Modified:
  head/usr.sbin/fifolog/lib/fifolog_int.c

Modified: head/usr.sbin/fifolog/lib/fifolog_int.c
==============================================================================
--- head/usr.sbin/fifolog/lib/fifolog_int.c	Mon Feb 28 06:54:14 2011	(r219093)
+++ head/usr.sbin/fifolog/lib/fifolog_int.c	Mon Feb 28 08:59:35 2011	(r219094)
@@ -43,24 +43,6 @@
 #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.
  *
  * Return value is NULL for success or a error description string to
@@ -88,6 +70,7 @@ fifolog_int_open_i(struct fifolog_file *
 
 	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->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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102280859.p1S8xZ2P031246>