subr_sbuf.c (87594) | subr_sbuf.c (88219) |
---|---|
1/*- 2 * Copyright (c) 2000 Poul-Henning Kamp and Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2000 Poul-Henning Kamp and Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/kern/subr_sbuf.c 87594 2001-12-10 05:51:45Z obrien $ | 28 * $FreeBSD: head/sys/kern/subr_sbuf.c 88219 2001-12-19 19:04:57Z dillon $ |
29 */ 30 31#include <sys/param.h> 32 33#ifdef _KERNEL 34#include <sys/ctype.h> 35#include <sys/kernel.h> 36#include <sys/malloc.h> --- 419 unchanged lines hidden (view full) --- 456} 457 458/* 459 * Clear an sbuf, free its buffer if necessary. 460 */ 461void 462sbuf_delete(struct sbuf *s) 463{ | 29 */ 30 31#include <sys/param.h> 32 33#ifdef _KERNEL 34#include <sys/ctype.h> 35#include <sys/kernel.h> 36#include <sys/malloc.h> --- 419 unchanged lines hidden (view full) --- 456} 457 458/* 459 * Clear an sbuf, free its buffer if necessary. 460 */ 461void 462sbuf_delete(struct sbuf *s) 463{ |
464 int isdyn; 465 |
|
464 assert_sbuf_integrity(s); 465 /* don't care if it's finished or not */ 466 467 if (SBUF_ISDYNAMIC(s)) 468 SBFREE(s->s_buf); | 466 assert_sbuf_integrity(s); 467 /* don't care if it's finished or not */ 468 469 if (SBUF_ISDYNAMIC(s)) 470 SBFREE(s->s_buf); |
471 isdyn = SBUF_ISDYNSTRUCT(s); |
|
469 bzero(s, sizeof *s); | 472 bzero(s, sizeof *s); |
470 if (SBUF_ISDYNSTRUCT(s)) | 473 if (isdyn) |
471 SBFREE(s); 472} | 474 SBFREE(s); 475} |