Ignore:
Timestamp:
Jan 29, 2007, 6:54:36 AM (18 years ago)
Author:
bird
Message:

Solaris + cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/kmkbuiltin/fts.c

    r621 r809  
    5656#include <stdlib.h>
    5757#include <string.h>
    58 #ifndef _MSC_VER
    5958#include <unistd.h>
    60 #else
    61 #include "mscfakes.h"
    62 #define dirfd(dir) -1
    63 #endif
    64 #include "ftsfake.h"
     59
     60#ifdef __sun__
     61# include "solfakes.h"
     62# define dirfd(dir) -1
     63#endif
     64#ifdef _MSC_VER
     65# include "mscfakes.h"
     66# define dirfd(dir) -1
     67#endif
    6568
    6669#if ! HAVE_NBTOOL_CONFIG_H
     70#ifndef __sun__
    6771#define HAVE_STRUCT_DIRENT_D_NAMLEN 1
     72#endif
    6873#endif
    6974
     
    7883#endif /* __LIBC12_SOURCE__ */
    7984#endif /* __weak_alias */
    80 #endif 
     85#endif
    8186
    8287#ifdef __LIBC12_SOURCE__
     
    120125#undef HAVE_STRUCT_DIRENT_D_NAMLEN
    121126#undef HAVE_FCHDIR
    122 #endif 
     127#endif
    123128
    124129#if defined(__EMX__) || defined(_MSC_VER)
     
    268273                if ((sp->fts_rdir = getcwd(NULL, 0)) != NULL)
    269274                        SET(FTS_NOCHDIR);
    270 #endif 
     275#endif
    271276        }
    272277
     
    374379                if (chdir(sp->fts_rdir))
    375380                        saved_errno =  errno;
    376         free(sp->fts_rdir); 
     381        free(sp->fts_rdir);
    377382                sp->fts_rdir = NULL;
    378 #endif 
     383#endif
    379384        }
    380385
     
    467472                        p->fts_info = FTS_DP;
    468473                        return (p);
    469                 } 
     474                }
    470475
    471476                /* Rebuild if only read the names and now traversing. */
     
    520525#else
    521526                        if (CHDIR(sp, sp->fts_rdir)) {
    522 #endif 
     527#endif
    523528                                SET(FTS_STOP);
    524529                                return (NULL);
     
    587592#else
    588593                if (CHDIR(sp, sp->fts_rdir)) {
    589 #endif 
     594#endif
    590595                        SET(FTS_STOP);
    591596                        return (NULL);
     
    691696                SET(FTS_NAMEONLY);
    692697                instr = BNAMES;
    693         } else 
     698        } else
    694699                instr = BCHILD;
    695700
     
    913918                } else if (nlinks == 0
    914919#ifdef DT_DIR
    915                     || (nostat && 
     920                    || (nostat &&
    916921                    dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
    917922#endif
     
    979984#else
    980985            CHDIR(sp, sp->fts_rdir) :
    981 #endif 
     986#endif
    982987            fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
    983988                cur->fts_info = FTS_ERR;
     
    10391044                                errno = 0;
    10401045                                return (FTS_SLNONE);
    1041                         } 
     1046                        }
    10421047                        p->fts_errno = saved_errno;
    10431048                        goto err;
     
    11141119        for (ap = sp->fts_array, p = head; p; p = p->fts_link)
    11151120                *ap++ = p;
    1116         qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), 
     1121        qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *),
    11171122                (int (*)(const void *, const void *))sp->fts_compar);
    11181123        for (head = *(ap = sp->fts_array); --nitems; ++ap)
     
    12221227 * Most systems will allow creation of paths much longer than MAXPATHLEN, even
    12231228 * though the kernel won't resolve them.  Round up the new size to a power of 2,
    1224  * so we don't realloc the path 2 bytes at a time. 
     1229 * so we don't realloc the path 2 bytes at a time.
    12251230 */
    12261231static int
Note: See TracChangeset for help on using the changeset viewer.