opendir.c (34357) | opendir.c (39327) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 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 --- 123 unchanged lines hidden (view full) --- 132 do { 133 /* 134 * Always make at least DIRBLKSIZ bytes 135 * available to getdirentries 136 */ 137 if (space < DIRBLKSIZ) { 138 space += incr; 139 len += incr; | 1/* 2 * Copyright (c) 1983, 1993 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 --- 123 unchanged lines hidden (view full) --- 132 do { 133 /* 134 * Always make at least DIRBLKSIZ bytes 135 * available to getdirentries 136 */ 137 if (space < DIRBLKSIZ) { 138 space += incr; 139 len += incr; |
140 buf = realloc(buf, len); | 140 buf = reallocf(buf, len); |
141 if (buf == NULL) 142 goto fail; 143 ddptr = buf + (len - space); 144 } 145 146 n = getdirentries(fd, ddptr, space, &dirp->dd_seek); 147 if (n > 0) { 148 ddptr += n; --- 126 unchanged lines hidden --- | 141 if (buf == NULL) 142 goto fail; 143 ddptr = buf + (len - space); 144 } 145 146 n = getdirentries(fd, ddptr, space, &dirp->dd_seek); 147 if (n > 0) { 148 ddptr += n; --- 126 unchanged lines hidden --- |