Changeset 39626 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Dec 15, 2011 11:33:47 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75420
- Location:
- trunk/src/VBox/Runtime/r3/posix
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp
r39612 r39626 194 194 195 195 196 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf )196 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf, uint32_t fOpen) 197 197 { 198 198 NOREF(pszPathBuf); /* only used on windows */ … … 205 205 if (RT_SUCCESS(rc)) 206 206 { 207 pDir->pDir = opendir(pszNativePath); 207 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 208 /* XXX Darwin? */ 209 if (fOpen & RTDIROPEN_FLAGS_NO_SYMLINKS) 210 { 211 const char *pszName; 212 int fhDir; 213 rc = rtPathOpenPathNoFollowFh(pszNativePath, &fhDir, &pszName); 214 printf("rtPathOpenPathNoFollowFh '%s' => %d\n", pszNativePath, rc); 215 AssertRCReturn(rc, rc); 216 if (pszName != NULL) 217 { 218 AssertMsgFailed(("Path name '%s' contains filename\n", pszNativePath)); 219 return VERR_INVALID_PARAMETER; 220 } 221 pDir->pDir = fdopendir(fhDir); 222 /* 223 * do NOT close fhDir, it will be closed implicitely when closing pDir! 224 */ 225 } 226 else 227 #endif 228 { 229 pDir->pDir = opendir(pszNativePath); 230 } 208 231 if (pDir->pDir) 209 232 { -
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r39083 r39626 204 204 return (rc); 205 205 206 int fh = open(pszNativeFilename, fOpenMode, fMode); 206 int fh; 207 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 208 /* XXX Darwin? */ 209 if (fOpen & RTFILE_O_NO_SYMLINKS) 210 { 211 const char *pszName; 212 int fhDir; 213 rc = rtPathOpenPathNoFollowFh(pszNativeFilename, &fhDir, &pszName); 214 if (RT_FAILURE(rc)) 215 { 216 rtPathFreeNative(pszNativeFilename, pszFilename); 217 return rc; 218 } 219 fh = openat(fhDir, pszName, fOpenMode, fMode | O_NOFOLLOW); 220 close(fhDir); 221 } 222 else 223 #endif 224 { 225 fh = open(pszNativeFilename, fOpenMode, fMode); 226 } 207 227 int iErr = errno; 208 228
Note:
See TracChangeset
for help on using the changeset viewer.