diff --git a/src/system/libroot/posix/fts.c b/src/system/libroot/posix/fts.c
index ce7ac95..0a68cbf 100644
a
|
b
|
static int fts_stat(FTS *, FTSENT *, int);
|
80 | 80 | static int fts_safe_changedir(FTS *, FTSENT *, int, char *); |
81 | 81 | static int fts_ufslinks(FTS *, const FTSENT *); |
82 | 82 | |
| 83 | |
| 84 | FTS * __fts_open(char * const *argv, int options, int (*compar)( |
| 85 | const FTSENT * const *, const FTSENT * const *)); |
| 86 | int __fts_close(FTS *sp); |
| 87 | FTSENT * __fts_read(FTS *sp); |
| 88 | int __fts_set(FTS *sp, FTSENT *p, int instr); |
| 89 | FTSENT * __fts_children(FTS *sp, int instr); |
| 90 | void *(__fts_get_clientptr)(FTS *sp); |
| 91 | FTS * (__fts_get_stream)(FTSENT *p); |
| 92 | void __fts_set_clientptr(FTS *sp, void *clientptr); |
| 93 | |
| 94 | |
| 95 | #undef weak_alias |
| 96 | #define weak_alias(name, aliasname) \ |
| 97 | extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); |
| 98 | |
83 | 99 | #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) |
84 | 100 | |
85 | 101 | #define CLR(opt) (sp->fts_options &= ~(opt)) |
… |
… |
static const char *ufslike_filesystems[] = {
|
128 | 144 | #endif /* !__HAIKU__ */ |
129 | 145 | |
130 | 146 | FTS * |
131 | | fts_open(argv, options, compar) |
| 147 | __fts_open(argv, options, compar) |
132 | 148 | char * const *argv; |
133 | 149 | int options; |
134 | 150 | int (*compar)(const FTSENT * const *, const FTSENT * const *); |
… |
… |
mem1: free(sp);
|
245 | 261 | return (NULL); |
246 | 262 | } |
247 | 263 | |
| 264 | |
| 265 | weak_alias (__fts_open, fts_open) |
| 266 | |
| 267 | |
248 | 268 | static void |
249 | 269 | fts_load(FTS *sp, FTSENT *p) |
250 | 270 | { |
… |
… |
fts_load(FTS *sp, FTSENT *p)
|
270 | 290 | } |
271 | 291 | |
272 | 292 | int |
273 | | fts_close(FTS *sp) |
| 293 | __fts_close(FTS *sp) |
274 | 294 | { |
275 | 295 | FTSENT *freep, *p; |
276 | 296 | int saved_errno; |
… |
… |
fts_close(FTS *sp)
|
315 | 335 | return (0); |
316 | 336 | } |
317 | 337 | |
| 338 | |
| 339 | weak_alias (__fts_close, fts_close) |
| 340 | |
| 341 | |
318 | 342 | /* |
319 | 343 | * Special case of "/" at the end of the path so that slashes aren't |
320 | 344 | * appended which would cause paths to be written as "....//foo". |
… |
… |
fts_close(FTS *sp)
|
324 | 348 | ? p->fts_pathlen - 1 : p->fts_pathlen) |
325 | 349 | |
326 | 350 | FTSENT * |
327 | | fts_read(FTS *sp) |
| 351 | __fts_read(FTS *sp) |
328 | 352 | { |
329 | 353 | FTSENT *p, *tmp; |
330 | 354 | int instr; |
… |
… |
name: t = sp->fts_path + NAPPEND(p->fts_parent);
|
510 | 534 | return (sp->fts_cur = p); |
511 | 535 | } |
512 | 536 | |
| 537 | |
| 538 | weak_alias (__fts_read, fts_read) |
| 539 | |
| 540 | |
513 | 541 | /* |
514 | 542 | * Fts_set takes the stream as an argument although it's not used in this |
515 | 543 | * implementation; it would be necessary if anyone wanted to add global |
… |
… |
name: t = sp->fts_path + NAPPEND(p->fts_parent);
|
518 | 546 | */ |
519 | 547 | /* ARGSUSED */ |
520 | 548 | int |
521 | | fts_set(FTS *sp, FTSENT *p, int instr) |
| 549 | __fts_set(FTS *sp, FTSENT *p, int instr) |
522 | 550 | { |
523 | 551 | if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW && |
524 | 552 | instr != FTS_NOINSTR && instr != FTS_SKIP) { |
… |
… |
fts_set(FTS *sp, FTSENT *p, int instr)
|
529 | 557 | return (0); |
530 | 558 | } |
531 | 559 | |
| 560 | |
| 561 | weak_alias (__fts_set, fts_set) |
| 562 | |
| 563 | |
532 | 564 | FTSENT * |
533 | | fts_children(FTS *sp, int instr) |
| 565 | __fts_children(FTS *sp, int instr) |
534 | 566 | { |
535 | 567 | FTSENT *p; |
536 | 568 | int fd; |
… |
… |
fts_children(FTS *sp, int instr)
|
597 | 629 | return (sp->fts_child); |
598 | 630 | } |
599 | 631 | |
| 632 | |
| 633 | weak_alias (__fts_children, fts_children) |
| 634 | |
| 635 | |
600 | 636 | #ifndef fts_get_clientptr |
601 | 637 | #error "fts_get_clientptr not defined" |
602 | 638 | #endif |
603 | 639 | |
604 | 640 | void * |
605 | | (fts_get_clientptr)(FTS *sp) |
| 641 | (__fts_get_clientptr)(FTS *sp) |
606 | 642 | { |
607 | 643 | |
608 | 644 | return (fts_get_clientptr(sp)); |
609 | 645 | } |
610 | 646 | |
| 647 | |
| 648 | weak_alias (__fts_get_clientptr, fts_get_clientptr) |
| 649 | |
| 650 | |
611 | 651 | #ifndef fts_get_stream |
612 | 652 | #error "fts_get_stream not defined" |
613 | 653 | #endif |
614 | 654 | |
615 | 655 | FTS * |
616 | | (fts_get_stream)(FTSENT *p) |
| 656 | (__fts_get_stream)(FTSENT *p) |
617 | 657 | { |
618 | 658 | return (fts_get_stream(p)); |
619 | 659 | } |
620 | 660 | |
| 661 | |
| 662 | weak_alias (__fts_get_stream, fts_get_stream) |
| 663 | |
| 664 | |
621 | 665 | void |
622 | | fts_set_clientptr(FTS *sp, void *clientptr) |
| 666 | __fts_set_clientptr(FTS *sp, void *clientptr) |
623 | 667 | { |
624 | 668 | |
625 | 669 | sp->fts_clientptr = clientptr; |
626 | 670 | } |
627 | 671 | |
| 672 | |
| 673 | weak_alias (__fts_set_clientptr, fts_set_clientptr) |
| 674 | |
| 675 | |
628 | 676 | /* |
629 | 677 | * This is the tricky part -- do not casually change *anything* in here. The |
630 | 678 | * idea is to build the linked list of entries that are used by fts_children |