telldir.c (174221) | telldir.c (178772) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)telldir.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> | 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 --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)telldir.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/lib/libc/gen/telldir.c 174221 2007-12-03 14:33:51Z des $"); | 34__FBSDID("$FreeBSD: head/lib/libc/gen/telldir.c 178772 2008-05-05 14:05:23Z kib $"); |
35 36#include "namespace.h" 37#include <sys/param.h> 38#include <sys/queue.h> 39#include <dirent.h> 40#include <pthread.h> 41#include <stdlib.h> 42#include <unistd.h> --- 50 unchanged lines hidden (view full) --- 93 if (lp == NULL) 94 return; 95 if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) 96 goto found; 97 (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); 98 dirp->dd_seek = lp->loc_seek; 99 dirp->dd_loc = 0; 100 while (dirp->dd_loc < lp->loc_loc) { | 35 36#include "namespace.h" 37#include <sys/param.h> 38#include <sys/queue.h> 39#include <dirent.h> 40#include <pthread.h> 41#include <stdlib.h> 42#include <unistd.h> --- 50 unchanged lines hidden (view full) --- 93 if (lp == NULL) 94 return; 95 if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) 96 goto found; 97 (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); 98 dirp->dd_seek = lp->loc_seek; 99 dirp->dd_loc = 0; 100 while (dirp->dd_loc < lp->loc_loc) { |
101 dp = _readdir_unlocked(dirp); | 101 dp = _readdir_unlocked(dirp, 0); |
102 if (dp == NULL) 103 break; 104 } 105found: 106#ifdef SINGLEUSE 107 LIST_REMOVE(lp, loc_lqe); 108 free((caddr_t)lp); 109#endif --- 20 unchanged lines hidden --- | 102 if (dp == NULL) 103 break; 104 } 105found: 106#ifdef SINGLEUSE 107 LIST_REMOVE(lp, loc_lqe); 108 free((caddr_t)lp); 109#endif --- 20 unchanged lines hidden --- |