- Timestamp:
- Mar 18, 2019, 1:22:01 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/os2/b_fsUnlink.c
r3862 r3951 30 30 31 31 /** 32 * Unlinks a file, directory, symlink, dev, pipe or socket.32 * Unlinks a file, symlink, dev, pipe or socket, but not a directory. 33 33 * 34 34 * @returns 0 on success. … … 50 50 */ 51 51 char szNativePath[PATH_MAX]; 52 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL_SYMLINK | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, &szNativePath[0], NULL);52 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL_SYMLINK, &szNativePath[0], NULL); 53 53 if (rc) 54 54 LIBCLOG_ERROR_RETURN_INT(rc); … … 90 90 * 3) we are denied access - network, hpfs386 or SES. 91 91 * 92 * If it's either of the first two we are subject to race conditions, so we 93 * have to retry. The third cause is distiguishable from the two othes by 94 * the failing DosSetPathInfo. 92 * If it's the first we are subject to race conditions, so we have to retry. 93 * The third cause is distiguishable from the two othes by the failing DosSetPathInfo. 95 94 */ 96 int fDirectory = 0;97 95 for (unsigned i = 0; (rc == ERROR_ACCESS_DENIED || rc == ERROR_PATH_NOT_FOUND) && i < 2; i++) 98 96 { … … 101 99 if (!rc) 102 100 { 103 fDirectory = (fsts3.attrFile & FILE_DIRECTORY) != 0; 101 /* Directory? */ 102 if ((fsts3.attrFile & FILE_DIRECTORY) != 0) 103 { 104 rc = ERROR_DIRECTORY; 105 break; 106 } 104 107 105 108 /* turn of the read-only attribute */ … … 118 121 119 122 /* retry */ 120 if (fDirectory) 121 rc = DosDeleteDir((PCSZ)&szNativePath[0]); 122 else if (s_fUseForce == 1) 123 if (s_fUseForce == 1) 123 124 rc = DosForceDelete((PCSZ)&szNativePath[0]); 124 125 else … … 140 141 { 141 142 if (rc == ERROR_ACCESS_DENIED) 142 rc = fDirectory ? -ENOTEMPTY : -EACCES; 143 rc = -EACCES; 144 else if (rc == ERROR_DIRECTORY) 145 rc = -EISDIR; 143 146 else 144 147 rc = -__libc_back_native2errno(rc);
Note:
See TracChangeset
for help on using the changeset viewer.