Changeset 3951 for branches/libc-0.6/src/emx
- Timestamp:
- Mar 18, 2019, 1:22:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/lib/sys/b_fsUnlink.c
r2542 r3951 45 45 46 46 /** 47 * Unlinks a file, directory, symlink, dev, pipe or socket.47 * Unlinks a file, symlink, dev, pipe or socket, but not a directory. 48 48 * 49 49 * @returns 0 on success. … … 65 65 */ 66 66 char szNativePath[PATH_MAX]; 67 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL_SYMLINK | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, &szNativePath[0], NULL);67 int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL_SYMLINK, &szNativePath[0], NULL); 68 68 if (rc) 69 69 LIBCLOG_ERROR_RETURN_INT(rc); … … 105 105 * 3) we are denied access - network, hpfs386 or SES. 106 106 * 107 * If it's either of the first two we are subject to race conditions, so we 108 * have to retry. The third cause is distiguishable from the two othes by 109 * the failing DosSetPathInfo. 107 * If it's the first we are subject to race conditions, so we have to retry. 108 * The third cause is distiguishable from the two othes by the failing DosSetPathInfo. 110 109 */ 111 int fDirectory = 0;112 110 for (unsigned i = 0; (rc == ERROR_ACCESS_DENIED || rc == ERROR_PATH_NOT_FOUND) && i < 2; i++) 113 111 { … … 116 114 if (!rc) 117 115 { 118 fDirectory = (fsts3.attrFile & FILE_DIRECTORY) != 0; 116 /* Directory? */ 117 if ((fsts3.attrFile & FILE_DIRECTORY) != 0) 118 { 119 rc = ERROR_DIRECTORY; 120 break; 121 } 119 122 120 123 /* turn of the read-only attribute */ … … 133 136 134 137 /* retry */ 135 if (fDirectory) 136 rc = DosDeleteDir((PCSZ)&szNativePath[0]); 137 else if (s_fUseForce == 1) 138 if (s_fUseForce == 1) 138 139 rc = DosForceDelete((PCSZ)&szNativePath[0]); 139 140 else … … 155 156 { 156 157 if (rc == ERROR_ACCESS_DENIED) 157 rc = fDirectory ? -ENOTEMPTY : -EACCES; 158 rc = -EACCES; 159 else if (rc == ERROR_DIRECTORY) 160 rc = -EISDIR; 158 161 else 159 162 rc = -__libc_native2errno(rc);
Note:
See TracChangeset
for help on using the changeset viewer.