Line
Link Here
|
0 |
-- lib/getcwd.c |
0 |
++ lib/getcwd.c |
Lines 101-110
Link Here
|
101 |
#endif |
101 |
#endif |
102 |
|
102 |
|
103 |
#if D_INO_IN_DIRENT |
103 |
#if D_INO_IN_DIRENT |
104 |
# define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino)) |
104 |
/*# define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino))*/ |
105 |
#else |
105 |
#else |
106 |
# define MATCHING_INO(dp, ino) true |
106 |
/*# define MATCHING_INO(dp, ino) true*/ |
107 |
#endif |
107 |
#endif |
|
|
108 |
/* Patch: Always ignore dirent.d_ino entries, even if they exist, |
109 |
although this slows down the getcwd algorithm. |
110 |
The reason is that for some filesystem (e.g. combination squashfs/unionfs) |
111 |
this gives a different value than stat() and thus confuses the algorithm. |
112 |
*/ |
113 |
# define MATCHING_INO(dp, ino) true |
114 |
|
108 |
|
115 |
|
109 |
#if !_LIBC |
116 |
#if !_LIBC |
110 |
# define __getcwd getcwd |
117 |
# define __getcwd getcwd |
Lines 153-159
Link Here
|
153 |
size_t allocated = size; |
160 |
size_t allocated = size; |
154 |
size_t used; |
161 |
size_t used; |
155 |
|
162 |
|
156 |
#if HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD |
163 |
/*#if HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD */ |
|
|
164 |
/* Patch: The above is commented out, because the system's getcwd should |
165 |
be preferred even if AT_FDCWD is defined, i.e. even if the following |
166 |
algorithm would be fast: The system's getcwd does not rely so much |
167 |
about D_INO_IN_DIRENT (see the above patch why this is bad). */ |
168 |
#if HAVE_PARTLY_WORKING_GETCWD |
157 |
/* The system getcwd works, except it sometimes fails when it |
169 |
/* The system getcwd works, except it sometimes fails when it |
158 |
shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If |
170 |
shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If |
159 |
AT_FDCWD is not defined, the algorithm below is O(N**2) and this |
171 |
AT_FDCWD is not defined, the algorithm below is O(N**2) and this |