--- BasiliskII/src/extfs.cpp 2001/02/02 20:52:57 1.24 +++ BasiliskII/src/extfs.cpp 2005/01/30 21:42:13 1.30 @@ -1,7 +1,7 @@ /* * extfs.cpp - MacOS file system for native file system access * - * Basilisk II (C) 1997-2001 Christian Bauer + * Basilisk II (C) 1997-2005 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -730,9 +730,6 @@ static int16 get_current_dir(uint32 pb, if (no_vol_name) WriteMacInt32(pb + ioNamePtr, name_ptr); int16 status = ReadMacInt16(fs_data + fsReturn); - int16 more_matches = ReadMacInt16(fs_data + fsReturn + 2); - int16 vRefNum = ReadMacInt16(fs_data + fsReturn + 4); - uint32 vcb = ReadMacInt32(fs_data + fsReturn + 6); D(bug(" UTDetermineVol() returned %d, status %d\n", r.d[0], status)); result = (int16)(r.d[0] & 0xffff); @@ -967,7 +964,9 @@ static int16 fs_volume_mount(uint32 pb) r.a[0] = fs_data + fsReturn; r.a[1] = fs_data + fsReturn + 2; Execute68k(fs_data + fsAllocateVCB, &r); +#if DEBUG uint16 sysVCBLength = ReadMacInt16(fs_data + fsReturn); +#endif uint32 vcb = ReadMacInt32(fs_data + fsReturn + 2); D(bug(" UTAllocateVCB() returned %d, vcb %08lx, size %d\n", r.d[0], vcb, sysVCBLength)); if (r.d[0] & 0xffff) @@ -976,11 +975,11 @@ static int16 fs_volume_mount(uint32 pb) // Init VCB WriteMacInt16(vcb + vcbSigWord, 0x4244); #if defined(__BEOS__) || defined(WIN32) - WriteMacInt32(vcb + vcbCrDate, root_stat.st_crtime + TIME_OFFSET); + WriteMacInt32(vcb + vcbCrDate, TimeToMacTime(root_stat.st_crtime)); #else WriteMacInt32(vcb + vcbCrDate, 0); #endif - WriteMacInt32(vcb + vcbLsMod, root_stat.st_mtime + TIME_OFFSET); + WriteMacInt32(vcb + vcbLsMod, TimeToMacTime(root_stat.st_mtime)); WriteMacInt32(vcb + vcbVolBkUp, 0); WriteMacInt16(vcb + vcbNmFls, 1); //!! WriteMacInt16(vcb + vcbNmRtDirs, 1); //!! @@ -1039,11 +1038,11 @@ static int16 fs_get_vol_info(uint32 pb, if (ReadMacInt32(pb + ioNamePtr)) pstrcpy((char *)Mac2HostAddr(ReadMacInt32(pb + ioNamePtr)), VOLUME_NAME); #if defined(__BEOS__) || defined(WIN32) - WriteMacInt32(pb + ioVCrDate, root_stat.st_crtime + TIME_OFFSET); + WriteMacInt32(pb + ioVCrDate, TimeToMacTime(root_stat.st_crtime)); #else WriteMacInt32(pb + ioVCrDate, 0); #endif - WriteMacInt32(pb + ioVLsMod, root_stat.st_mtime + TIME_OFFSET); + WriteMacInt32(pb + ioVLsMod, TimeToMacTime(root_stat.st_mtime)); WriteMacInt16(pb + ioVAtrb, 0); WriteMacInt16(pb + ioVNmFls, 1); //!! WriteMacInt16(pb + ioVBitMap, 0); @@ -1231,13 +1230,13 @@ read_next_de: WriteMacInt32(pb + ioDirID, fs_item->id); #if defined(__BEOS__) || defined(WIN32) - WriteMacInt32(pb + ioFlCrDat, st.st_crtime + TIME_OFFSET); + WriteMacInt32(pb + ioFlCrDat, TimeToMacTime(st.st_crtime)); #else WriteMacInt32(pb + ioFlCrDat, 0); #endif - WriteMacInt32(pb + ioFlMdDat, st.st_mtime + TIME_OFFSET); + WriteMacInt32(pb + ioFlMdDat, TimeToMacTime(st.st_mtime)); - get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0); + get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0, false); WriteMacInt16(pb + ioFlStBlk, 0); WriteMacInt32(pb + ioFlLgLen, st.st_size); @@ -1274,7 +1273,7 @@ static int16 fs_set_file_info(uint32 pb, return fnfErr; // Set Finder info - set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0); + set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0, false); //!! times return noErr; @@ -1353,7 +1352,7 @@ read_next_de: WriteMacInt32(pb + ioDirID, fs_item->id); WriteMacInt32(pb + ioFlParID, fs_item->parent_id); #if defined(__BEOS__) || defined(WIN32) - WriteMacInt32(pb + ioFlCrDat, st.st_crtime + TIME_OFFSET); + WriteMacInt32(pb + ioFlCrDat, TimeToMacTime(st.st_crtime)); #else WriteMacInt32(pb + ioFlCrDat, 0); #endif @@ -1363,10 +1362,10 @@ read_next_de: fs_item->mtime = mtime; cached = false; } - WriteMacInt32(pb + ioFlMdDat, mtime + TIME_OFFSET); + WriteMacInt32(pb + ioFlMdDat, TimeToMacTime(mtime)); WriteMacInt32(pb + ioFlBkDat, 0); - get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo); + get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo, S_ISDIR(st.st_mode)); if (S_ISDIR(st.st_mode)) { @@ -1422,7 +1421,7 @@ static int16 fs_set_cat_info(uint32 pb) return errno2oserr(); // Set Finder info - set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo); + set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo, S_ISDIR(st.st_mode)); //!! times return noErr; @@ -1510,7 +1509,7 @@ static int16 fs_open(uint32 pb, uint32 d WriteMacInt32(fcb + fcbVPtr, vcb); WriteMacInt32(fcb + fcbClmpSize, CLUMP_SIZE); - get_finfo(full_path, fs_data + fsPB, 0); + get_finfo(full_path, fs_data + fsPB, 0, false); WriteMacInt32(fcb + fcbFType, ReadMacInt32(fs_data + fsPB + fdType)); WriteMacInt32(fcb + fcbCatPos, fd);