version 1.40, 2004/12/07 18:14:04 |
version 1.41, 2004/12/08 19:44:28 |
|
|
static int |
static int |
cvs_file_cmp(const void *f1, const void *f2) |
cvs_file_cmp(const void *f1, const void *f2) |
{ |
{ |
CVSFILE *cf1, *cf2; |
const CVSFILE *cf1, *cf2; |
cf1 = *(CVSFILE **)f1; |
cf1 = *(const CVSFILE **)f1; |
cf2 = *(CVSFILE **)f2; |
cf2 = *(const CVSFILE **)f2; |
return cvs_file_cmpname(CVS_FILE_NAME(cf1), CVS_FILE_NAME(cf2)); |
return cvs_file_cmpname(CVS_FILE_NAME(cf1), CVS_FILE_NAME(cf2)); |
} |
} |
|
|
|
|
if (type == DT_DIR) { |
if (type == DT_DIR) { |
ddat = (struct cvs_dir *)malloc(sizeof(*ddat)); |
ddat = (struct cvs_dir *)malloc(sizeof(*ddat)); |
if (ddat == NULL) { |
if (ddat == NULL) { |
|
cvs_log(LP_ERRNO, "failed to allocate directory data"); |
cvs_file_free(cfp); |
cvs_file_free(cfp); |
return (NULL); |
return (NULL); |
} |
} |
|
|
} |
} |
|
|
cfp = cvs_file_alloc(path, IFTODT(st.st_mode)); |
cfp = cvs_file_alloc(path, IFTODT(st.st_mode)); |
if (cfp == NULL) { |
if (cfp == NULL) |
cvs_log(LP_ERRNO, "failed to allocate CVS file data"); |
|
return (NULL); |
return (NULL); |
} |
|
cfp->cf_parent = parent; |
cfp->cf_parent = parent; |
cfp->cf_mode = st.st_mode & ACCESSPERMS; |
cfp->cf_mode = st.st_mode & ACCESSPERMS; |
cfp->cf_mtime = st.st_mtime; |
cfp->cf_mtime = st.st_mtime; |