Changeset 79467 in vbox
- Timestamp:
- Jul 2, 2019 3:14:30 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131729
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp
r79421 r79467 169 169 { 170 170 rc = errno; 171 if (rc == EEXIST) /* Solaris returns this, the rest have ENOT DIR. */171 if (rc == EEXIST) /* Solaris returns this, the rest have ENOTEMPTY. */ 172 172 rc = VERR_DIR_NOT_EMPTY; 173 173 else if (rc != ENOTDIR) … … 175 175 else 176 176 { 177 rc = RTErrConvertFromErrno(rc); 177 /* 178 * This may be a valid path-not-found or it may be a non-directory in 179 * the final component. FsPerf want us to distinguish between the two, 180 * and trailing slash shouldn't matter because it doesn't on windows... 181 */ 182 char *pszFree = NULL; 183 const char *pszStat = pszNativePath; 184 size_t cch = strlen(pszNativePath); 185 if (cch > 2 && pszNativePath[cch - 1] == '/') 186 { 187 pszStat = pszFree = RTMemTmpAlloc(cch); 188 memcpy(pszFree, pszNativePath, cch); 189 do 190 pszFree[--cch] = '\0'; 191 while (cch > 2 && pszFree[cch - 1] == '/'); 192 } 193 178 194 struct stat st; 179 if (!stat(psz NativePath, &st) && !S_ISDIR(st.st_mode))195 if (!stat(pszStat, &st) && !S_ISDIR(st.st_mode)) 180 196 rc = VERR_NOT_A_DIRECTORY; 197 else 198 rc = VERR_PATH_NOT_FOUND; 199 200 if (pszFree) 201 RTMemTmpFree(pszFree); 181 202 } 182 203 }
Note:
See TracChangeset
for help on using the changeset viewer.