- Timestamp:
- Oct 24, 2014, 1:03:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/os2/fs-os2.c
r3911 r3912 303 303 __libc_gcchUnixRoot = cch; 304 304 305 ULONG ulDisk, ulIgnored; 306 rc = DosQueryCurrentDisk(&ulDisk, &ulIgnored); 307 if ( rc == NO_ERROR 308 && ulDisk + 'A' - 1 == __libc_gszUnixRoot[0]) 305 if (!getenv("UNIXROOT_OUTSIDE")) 309 306 { 310 if (cch == 3) 311 __libc_gfInUnixTree = 1; 312 else 307 ULONG ulDisk, ulIgnored; 308 rc = DosQueryCurrentDisk(&ulDisk, &ulIgnored); 309 if ( rc == NO_ERROR 310 && ulDisk + 'A' - 1 == __libc_gszUnixRoot[0]) 313 311 { 314 char szCurDir[PATH_MAX]; 315 ULONG cbCurDir = sizeof(szCurDir); 316 rc = DosQueryCurrentDir(0, (PSZ)&szCurDir[0], &cbCurDir); 317 __libc_gfInUnixTree = rc == NO_ERROR 318 && cch <= cbCurDir + 3 319 && memicmp(&__libc_gszUnixRoot[3], szCurDir, cch - 3) == 0 320 && ( cch == cbCurDir + 3 321 || szCurDir[cch - 3] == '\\'); 312 if (cch == 3) 313 __libc_gfInUnixTree = 1; 314 else 315 { 316 char szCurDir[PATH_MAX]; 317 ULONG cbCurDir = sizeof(szCurDir); 318 rc = DosQueryCurrentDir(0, (PSZ)&szCurDir[0], &cbCurDir); 319 __libc_gfInUnixTree = rc == NO_ERROR 320 && cch <= cbCurDir + 3 321 && memicmp(&__libc_gszUnixRoot[3], szCurDir, cch - 3) == 0 322 && ( cch == cbCurDir + 3 323 || szCurDir[cch - 3] == '\\'); 324 } 325 322 326 } 323 324 327 } 325 328 LIBCLOG_MSG(__libc_gfInUnixTree ? "Inside unixroot chroot.\n" : "Outside unixroot chroot.\n");
Note:
See TracChangeset
for help on using the changeset viewer.