Ticket #230: chmod_HPFS386.diff
| File chmod_HPFS386.diff, 3.8 KB (added by , 15 years ago) |
|---|
-
b_fsFileModeSetFH.c
124 124 && pFH->pFsInfo 125 125 && pFH->pFsInfo->fUnixEAs) 126 126 { 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 127 146 mode_t CurMode; 128 147 rc = __libc_back_fsUnixAttribsGetMode(fh, pFH->pszNativePath, &CurMode); 129 148 if (__predict_true(!rc)) … … 178 197 179 198 if (__predict_false(rc != 0)) 180 199 { 200 201 202 203 181 204 FS_RESTORE(); 182 205 LIBCLOG_ERROR_RETURN_INT(rc); 183 206 } -
b_fsNativeFileModeSet.c
126 126 } 127 127 128 128 /* 129 * Update OS/2 attributes. 129 * Update OS/2 attributes. Note that in fUnixEAs mode we temporarily remove 130 * the FILE_READONLY bit because on some file systems (e.g. HPFS386) setting 131 * EAs on a read-only file fails with ERROR_ACCESS_DENIED. 130 132 */ 131 133 #if OFF_MAX > LONG_MAX 132 134 if (fLarge) 133 135 { 134 if ( Mode & S_IWRITE)136 if () 135 137 info.fsts4L.attrFile &= ~FILE_READONLY; 136 138 else 137 info.fsts4L.attrFile = FILE_READONLY; 139 { 140 if (Mode & S_IWRITE) 141 info.fsts4L.attrFile &= ~FILE_READONLY; 142 else 143 info.fsts4L.attrFile |= FILE_READONLY; 144 } 138 145 rc = DosSetPathInfo((PCSZ)pszNativePath, FIL_STANDARDL, &info, sizeof(info.fsts4L) - sizeof(info.fsts4L.cbList), 0); 139 146 } 140 147 else 141 148 #endif 142 149 { 143 if ( Mode & S_IWRITE)150 if () 144 151 info.fsts4.attrFile &= ~FILE_READONLY; 145 152 else 146 info.fsts4.attrFile |= FILE_READONLY; 153 { 154 if (Mode & S_IWRITE) 155 info.fsts4.attrFile &= ~FILE_READONLY; 156 else 157 info.fsts4.attrFile |= FILE_READONLY; 158 } 147 159 rc = DosSetPathInfo((PCSZ)pszNativePath, FIL_STANDARD, &info, sizeof(info.fsts4) - sizeof(info.fsts4.cbList), 0); 148 160 } 149 161 if (__predict_false(rc != NO_ERROR)) … … 203 215 else if (rc == -ENOTSUP) 204 216 rc = 0; 205 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 206 235 if (__predict_false(rc != 0)) 207 236 { 208 237 FS_RESTORE();
