… | |
… | |
1061 | { |
1061 | { |
1062 | /* in this case, all is known, and we just put dirs first and sort them */ |
1062 | /* in this case, all is known, and we just put dirs first and sort them */ |
1063 | eio_dirent *ent = dents + dentoffs; |
1063 | eio_dirent *ent = dents + dentoffs; |
1064 | eio_dirent *dir = dents; |
1064 | eio_dirent *dir = dents; |
1065 | |
1065 | |
|
|
1066 | /* now move dirs to the front, and non-dirs to the back */ |
|
|
1067 | /* by walkign from both sides and swapping if necessary */ |
1066 | while (ent > dir) |
1068 | while (ent > dir) |
1067 | { |
1069 | { |
1068 | if (dir->type == DT_DIR) |
1070 | if (dir->type == DT_DIR) |
1069 | ++dir; |
1071 | ++dir; |
1070 | else |
1072 | else |
… | |
… | |
1209 | } |
1211 | } |
1210 | |
1212 | |
1211 | namesoffs += len; |
1213 | namesoffs += len; |
1212 | ++dentoffs; |
1214 | ++dentoffs; |
1213 | } |
1215 | } |
|
|
1216 | |
|
|
1217 | if (EIO_CANCELLED (req)) |
|
|
1218 | { |
|
|
1219 | errno = ECANCELED; |
|
|
1220 | break; |
|
|
1221 | } |
1214 | } |
1222 | } |
1215 | else |
|
|
1216 | req->result = -1; |
|
|
1217 | } |
1223 | } |
1218 | |
1224 | |
1219 | #if !(_POSIX_MAPPED_FILES && _POSIX_SYNCHRONIZED_IO) |
1225 | #if !(_POSIX_MAPPED_FILES && _POSIX_SYNCHRONIZED_IO) |
1220 | # undef msync |
1226 | # undef msync |
1221 | # define msync(a,b,c) ((errno = ENOSYS), -1) |
1227 | # define msync(a,b,c) ((errno = ENOSYS), -1) |