- Timestamp:
- Dec 7, 2004, 5:19:13 AM (21 years ago)
- Location:
- trunk/src/emx/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/misc/dirent.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r1714 r1715 12 12 #include <emx/syscalls.h> 13 13 #include <emx/umalloc.h> 14 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_IO 15 #include <InnoTekLIBC/logstrict.h> 14 16 15 17 … … 50 52 DIR *_STD(opendir)(const char *name) 51 53 { 54 LIBCLOG_ENTER("name=%p:{%s}\n", (void *)name, name); 52 55 struct stat statb; 53 56 struct _find find; … … 74 77 */ 75 78 if (stat(nbuf, &statb) < 0) 76 return NULL;79 LIBCLOG_RETURN_P(NULL); 77 80 if ((statb.st_mode & S_IFMT) != S_IFDIR) 78 81 { 79 82 errno = ENOTDIR; 80 return NULL;83 LIBCLOG_RETURN_P(NULL); 81 84 } 82 85 … … 90 93 { 91 94 errno = ENOMEM; 92 return NULL;95 LIBCLOG_RETURN_P(NULL); 93 96 } 94 97 if (!*psz) /* If dot was added. */ … … 102 105 { 103 106 errno = ENOMEM; 104 return pdir; /* why no free and return? */107 LIBCLOG_RETURN_P(pdir); /* why no free and return? */ 105 108 } 106 109 … … 121 124 free_dircontents(pdir->dd_contents); 122 125 errno = ENOMEM; 123 return NULL;126 LIBCLOG_RETURN_P(NULL); 124 127 } 125 128 dp->_d_entry = (char*)(dp + 1); … … 151 154 pdir->dd_cp = pdir->dd_contents; 152 155 errno = saved_errno; /* getdirent/findnext sets errno when done */ 153 return pdir;156 LIBCLOG_RETURN_P(pdir); 154 157 } 155 158 … … 157 160 int _STD(readdir_r)(DIR *dirp, struct dirent *pdent, struct dirent **ppdent) 158 161 { 162 LIBCLOG_ENTER("dirp=%p pdent=%p ppdent=%p\n", (void *)dirp, (void *)pdent, (void *)ppdent); 159 163 int cch; 160 164 /* done? */ … … 163 167 errno = ENOENT; 164 168 *ppdent = NULL; 165 return -1;169 LIBCLOG_RETURN_P(-1); 166 170 } 167 171 … … 188 192 dirp->dd_loc++; 189 193 *ppdent = pdent; 190 return 0;194 LIBCLOG_RETURN_P(0); 191 195 } 192 196 … … 203 207 void _STD(seekdir)(DIR *dirp, long off) 204 208 { 209 LIBCLOG_ENTER("dirp=%p off=%ld\n", (void *)dirp, off); 205 210 if (off >= 0) 206 211 { … … 216 221 else 217 222 errno = EINVAL; 223 LIBCLOG_RETURN_VOID(); 218 224 } 219 225 … … 227 233 long _STD(telldir)(DIR *dirp) 228 234 { 229 return dirp->dd_loc; 235 LIBCLOG_ENTER("dirp=%p\n", (void *)dirp); 236 LIBCLOG_RETURN_LONG(dirp->dd_loc); 230 237 } 231 238 … … 233 240 int _STD(closedir)(DIR *dirp) 234 241 { 242 LIBCLOG_ENTER("dirp=%p\n", (void *)dirp); 235 243 free_dircontents(dirp->dd_contents); 236 244 free(dirp); 237 return 0;238 } 239 245 LIBCLOG_RETURN_INT(0); 246 } 247 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsFileStat.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1714 r1715 52 52 */ 53 53 char szNativePath[PATH_MAX]; 54 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL , szNativePath, NULL);54 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, szNativePath, NULL); 55 55 if (!rc) 56 56 rc = __libc_back_fsNativeFileStat(szNativePath, pStat); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsPathResolve.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1714 r1715 66 66 int fInUnixTree; 67 67 char szNativePath[PATH_MAX]; 68 rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL , szNativePath, &fInUnixTree);68 rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, szNativePath, &fInUnixTree); 69 69 if (!rc) 70 70 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsStat.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1714 r1715 75 75 /** @todo Check if fsstat() can work on a non-existing path spec. */ 76 76 char szNativePath[PATH_MAX]; 77 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL , &szNativePath[0], NULL);77 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, &szNativePath[0], NULL); 78 78 if (rc) 79 79 LIBCLOG_RETURN_INT(rc); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsSymlinkStat.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1714 r1715 53 53 */ 54 54 char szNativePath[PATH_MAX]; 55 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_ PARENT, szNativePath, NULL);55 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL, szNativePath, NULL); 56 56 if (!rc) 57 57 rc = __libc_back_fsNativeFileStat(szNativePath, pStat); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.