cache.c (877155d0f5389f7f63e01cfd68d59789a96db9a0) | cache.c (a885d9dcf9631f6bc175a29bf5427c8218d1fbea) |
---|---|
1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * | 1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * |
37 * $Id: cache.c,v 1.6 1997/02/22 14:04:21 peter Exp $ | 37 * $Id: cache.c,v 1.7 1997/06/02 06:30:06 charnier Exp $ |
38 */ 39 40#ifndef lint 41static char const sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93"; 42#endif /* not lint */ 43 44#include <sys/types.h> 45#include <sys/time.h> --- 41 unchanged lines hidden (view full) --- 87 static int fail = 0; 88 89 if (uidtb != NULL) 90 return(0); 91 if (fail) 92 return(-1); 93 if ((uidtb = (UIDC **)calloc(UID_SZ, sizeof(UIDC *))) == NULL) { 94 ++fail; | 38 */ 39 40#ifndef lint 41static char const sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93"; 42#endif /* not lint */ 43 44#include <sys/types.h> 45#include <sys/time.h> --- 41 unchanged lines hidden (view full) --- 87 static int fail = 0; 88 89 if (uidtb != NULL) 90 return(0); 91 if (fail) 92 return(-1); 93 if ((uidtb = (UIDC **)calloc(UID_SZ, sizeof(UIDC *))) == NULL) { 94 ++fail; |
95 warn(1, "Unable to allocate memory for user id cache table"); | 95 pax_warn(1, "Unable to allocate memory for user id cache table"); |
96 return(-1); 97 } 98 return(0); 99} 100 101/* 102 * gidtb_start 103 * creates an an empty gidtb --- 12 unchanged lines hidden (view full) --- 116 static int fail = 0; 117 118 if (gidtb != NULL) 119 return(0); 120 if (fail) 121 return(-1); 122 if ((gidtb = (GIDC **)calloc(GID_SZ, sizeof(GIDC *))) == NULL) { 123 ++fail; | 96 return(-1); 97 } 98 return(0); 99} 100 101/* 102 * gidtb_start 103 * creates an an empty gidtb --- 12 unchanged lines hidden (view full) --- 116 static int fail = 0; 117 118 if (gidtb != NULL) 119 return(0); 120 if (fail) 121 return(-1); 122 if ((gidtb = (GIDC **)calloc(GID_SZ, sizeof(GIDC *))) == NULL) { 123 ++fail; |
124 warn(1, "Unable to allocate memory for group id cache table"); | 124 pax_warn(1, "Unable to allocate memory for group id cache table"); |
125 return(-1); 126 } 127 return(0); 128} 129 130/* 131 * usrtb_start 132 * creates an an empty usrtb --- 12 unchanged lines hidden (view full) --- 145 static int fail = 0; 146 147 if (usrtb != NULL) 148 return(0); 149 if (fail) 150 return(-1); 151 if ((usrtb = (UIDC **)calloc(UNM_SZ, sizeof(UIDC *))) == NULL) { 152 ++fail; | 125 return(-1); 126 } 127 return(0); 128} 129 130/* 131 * usrtb_start 132 * creates an an empty usrtb --- 12 unchanged lines hidden (view full) --- 145 static int fail = 0; 146 147 if (usrtb != NULL) 148 return(0); 149 if (fail) 150 return(-1); 151 if ((usrtb = (UIDC **)calloc(UNM_SZ, sizeof(UIDC *))) == NULL) { 152 ++fail; |
153 warn(1, "Unable to allocate memory for user name cache table"); | 153 pax_warn(1, "Unable to allocate memory for user name cache table"); |
154 return(-1); 155 } 156 return(0); 157} 158 159/* 160 * grptb_start 161 * creates an an empty grptb --- 12 unchanged lines hidden (view full) --- 174 static int fail = 0; 175 176 if (grptb != NULL) 177 return(0); 178 if (fail) 179 return(-1); 180 if ((grptb = (GIDC **)calloc(GNM_SZ, sizeof(GIDC *))) == NULL) { 181 ++fail; | 154 return(-1); 155 } 156 return(0); 157} 158 159/* 160 * grptb_start 161 * creates an an empty grptb --- 12 unchanged lines hidden (view full) --- 174 static int fail = 0; 175 176 if (grptb != NULL) 177 return(0); 178 if (fail) 179 return(-1); 180 if ((grptb = (GIDC **)calloc(GNM_SZ, sizeof(GIDC *))) == NULL) { 181 ++fail; |
182 warn(1,"Unable to allocate memory for group name cache table"); | 182 pax_warn(1,"Unable to allocate memory for group name cache table"); |
183 return(-1); 184 } 185 return(0); 186} 187 188/* 189 * name_uid() 190 * caches the name (if any) for the uid. If frc set, we always return the --- 290 unchanged lines hidden --- | 183 return(-1); 184 } 185 return(0); 186} 187 188/* 189 * name_uid() 190 * caches the name (if any) for the uid. If frc set, we always return the --- 290 unchanged lines hidden --- |