rec_close.c (55837) | rec_close.c (56698) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. 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 --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. 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 --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/lib/libc/db/recno/rec_close.c 55837 2000-01-12 09:23:48Z jasone $ | 33 * $FreeBSD: head/lib/libc/db/recno/rec_close.c 56698 2000-01-27 23:07:25Z jasone $ |
34 */ 35 36#if defined(LIBC_SCCS) && !defined(lint) 37static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94"; 38#endif /* LIBC_SCCS and not lint */ 39 40#include <sys/types.h> 41#include <sys/uio.h> --- 39 unchanged lines hidden (view full) --- 81 if (F_ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize)) 82 status = RET_ERROR; 83 84 if (!F_ISSET(t, R_INMEM)) 85 if (F_ISSET(t, R_CLOSEFP)) { 86 if (fclose(t->bt_rfp)) 87 status = RET_ERROR; 88 } else | 34 */ 35 36#if defined(LIBC_SCCS) && !defined(lint) 37static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94"; 38#endif /* LIBC_SCCS and not lint */ 39 40#include <sys/types.h> 41#include <sys/uio.h> --- 39 unchanged lines hidden (view full) --- 81 if (F_ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize)) 82 status = RET_ERROR; 83 84 if (!F_ISSET(t, R_INMEM)) 85 if (F_ISSET(t, R_CLOSEFP)) { 86 if (fclose(t->bt_rfp)) 87 status = RET_ERROR; 88 } else |
89 if (_libc_close(t->bt_rfd)) | 89 if (_close(t->bt_rfd)) |
90 status = RET_ERROR; 91 92 if (__bt_close(dbp) == RET_ERROR) 93 status = RET_ERROR; 94 95 return (status); 96} 97 --- 49 unchanged lines hidden (view full) --- 147 if (F_ISSET(t, R_FIXLEN)) { 148 /* 149 * We assume that fixed length records are all fixed length. 150 * Any that aren't are either EINVAL'd or corrected by the 151 * record put code. 152 */ 153 status = (dbp->seq)(dbp, &key, &data, R_FIRST); 154 while (status == RET_SUCCESS) { | 90 status = RET_ERROR; 91 92 if (__bt_close(dbp) == RET_ERROR) 93 status = RET_ERROR; 94 95 return (status); 96} 97 --- 49 unchanged lines hidden (view full) --- 147 if (F_ISSET(t, R_FIXLEN)) { 148 /* 149 * We assume that fixed length records are all fixed length. 150 * Any that aren't are either EINVAL'd or corrected by the 151 * record put code. 152 */ 153 status = (dbp->seq)(dbp, &key, &data, R_FIRST); 154 while (status == RET_SUCCESS) { |
155 if (_libc_write(t->bt_rfd, data.data, data.size) != | 155 if (_write(t->bt_rfd, data.data, data.size) != |
156 data.size) 157 return (RET_ERROR); 158 status = (dbp->seq)(dbp, &key, &data, R_NEXT); 159 } 160 } else { 161 iov[1].iov_base = (char *)&t->bt_bval; 162 iov[1].iov_len = 1; 163 --- 22 unchanged lines hidden --- | 156 data.size) 157 return (RET_ERROR); 158 status = (dbp->seq)(dbp, &key, &data, R_NEXT); 159 } 160 } else { 161 iov[1].iov_base = (char *)&t->bt_bval; 162 iov[1].iov_len = 1; 163 --- 22 unchanged lines hidden --- |