comparison src/fileio.c @ 4824:c12b646d84ee

changes to get things to compile under latest cygwin
author Ben Wing <ben@xemacs.org>
date Thu, 24 Dec 2009 19:45:23 -0600
parents aa5ed11f473b
children 780bb5441c14
comparison
equal deleted inserted replaced
4785:d6cfba1cc388 4824:c12b646d84ee
2323 static int 2323 static int
2324 check_writable (const Ibyte *filename) 2324 check_writable (const Ibyte *filename)
2325 { 2325 {
2326 #if defined(WIN32_NATIVE) || defined(CYGWIN) 2326 #if defined(WIN32_NATIVE) || defined(CYGWIN)
2327 #ifdef CYGWIN 2327 #ifdef CYGWIN
2328 char filename_buffer[PATH_MAX]; 2328 Extbyte filename_buffer[PATH_MAX];
2329 #endif 2329 #endif
2330 // Since this has to work for a directory, we can't just call 'CreateFile' 2330 // Since this has to work for a directory, we can't just call 'CreateFile'
2331 PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */ 2331 PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
2332 /* these need not be freed, they point into pDesc */ 2332 /* these need not be freed, they point into pDesc */
2333 PSID psidOwner; 2333 PSID psidOwner;
2344 DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET ); 2344 DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
2345 BOOL fAccessGranted = FALSE; 2345 BOOL fAccessGranted = FALSE;
2346 DWORD dwAccessAllowed; 2346 DWORD dwAccessAllowed;
2347 Extbyte *fnameext; 2347 Extbyte *fnameext;
2348 2348
2349 C_STRING_TO_TSTR(filename, fnameext);
2350
2349 #ifdef CYGWIN 2351 #ifdef CYGWIN
2350 cygwin_conv_to_full_win32_path(filename, filename_buffer); 2352 cygwin_conv_to_full_win32_path(fnameext, filename_buffer);
2351 filename = (Ibyte*)filename_buffer; 2353 fnameext = filename_buffer;
2352 #endif 2354 #endif
2353
2354 C_STRING_TO_TSTR(filename, fnameext);
2355 2355
2356 // First check for a normal file with the old-style readonly bit 2356 // First check for a normal file with the old-style readonly bit
2357 attributes = qxeGetFileAttributes(fnameext); 2357 attributes = qxeGetFileAttributes(fnameext);
2358 if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY))) 2358 if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
2359 return 0; 2359 return 0;