ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/extfs.cpp
(Generate patch)

Comparing BasiliskII/src/extfs.cpp (file contents):
Revision 1.13 by cebix, 1999-11-08T18:05:55Z vs.
Revision 1.14 by cebix, 1999-11-15T15:01:34Z

# Line 1063 | Line 1063 | static int16 fs_get_vol_parms(uint32 pb)
1063   //      D(bug(" fs_get_vol_parms(%08lx)\n", pb));
1064  
1065          // Return parameter block
1066        uint8 vol[SIZEOF_GetVolParmsInfoBuffer];
1067        WriteMacInt16((uint32)vol + vMVersion, 2);
1068        WriteMacInt32((uint32)vol + vMAttrib, kNoMiniFndr | kNoVNEdit | kNoLclSync | kTrshOffLine | kNoSwitchTo | kNoBootBlks | kNoSysDir | kHasExtFSVol);
1069        WriteMacInt32((uint32)vol + vMLocalHand, 0);
1070        WriteMacInt32((uint32)vol + vMServerAdr, 0);
1071        WriteMacInt32((uint32)vol + vMVolumeGrade, 0);
1072        WriteMacInt16((uint32)vol + vMForeignPrivID, 0);
1066          uint32 actual = ReadMacInt32(pb + ioReqCount);
1067 <        if (actual > sizeof(vol))
1068 <                actual = sizeof(vol);
1076 <        Host2Mac_memcpy(ReadMacInt32(pb + ioBuffer), vol, actual);
1067 >        if (actual > SIZEOF_GetVolParmsInfoBuffer)
1068 >                actual = SIZEOF_GetVolParmsInfoBuffer;
1069          WriteMacInt32(pb + ioActCount, actual);
1070 +        uint32 p = ReadMacInt32(pb + ioBuffer);
1071 +        if (actual > vMVersion) WriteMacInt16(p + vMVersion, 2);
1072 +        if (actual > vMAttrib) WriteMacInt32(p + vMAttrib, kNoMiniFndr | kNoVNEdit | kNoLclSync | kTrshOffLine | kNoSwitchTo | kNoBootBlks | kNoSysDir | kHasExtFSVol);
1073 +        if (actual > vMLocalHand) WriteMacInt32(p + vMLocalHand, 0);
1074 +        if (actual > vMServerAdr) WriteMacInt32(p + vMServerAdr, 0);
1075 +        if (actual > vMVolumeGrade) WriteMacInt32(p + vMVolumeGrade, 0);
1076 +        if (actual > vMForeignPrivID) WriteMacInt16(p + vMForeignPrivID, 0);
1077          return noErr;
1078   }
1079  
# Line 1475 | Line 1474 | static int16 fs_open(uint32 pb, uint32 d
1474                          return fnfErr;
1475                  fd = open_rfork(full_path, flag);
1476                  if (fd > 0) {
1477 <                        if (fstat(fd, &st) < 0)
1477 >                        if (fstat(fd, &st) < 0) {
1478 >                                close(fd);
1479                                  return errno2oserr();
1480 +                        }
1481                  } else {        // Resource fork not supported, silently ignore it ("pseudo" resource fork)
1482                          st.st_size = 0;
1483                          st.st_mode = 0;
# Line 1485 | Line 1486 | static int16 fs_open(uint32 pb, uint32 d
1486                  fd = open(full_path, flag);
1487                  if (fd < 0)
1488                          return errno2oserr();
1489 <                if (fstat(fd, &st) < 0)
1489 >                if (fstat(fd, &st) < 0) {
1490 >                        close(fd);
1491                          return errno2oserr();
1492 +                }
1493          }
1494  
1495          // File open, allocate FCB
# Line 1509 | Line 1512 | static int16 fs_open(uint32 pb, uint32 d
1512          WriteMacInt32(fcb + fcbCrPs, 0);
1513          WriteMacInt32(fcb + fcbVPtr, vcb);
1514          WriteMacInt32(fcb + fcbClmpSize, 1024);
1515 <        uint32 type, creator;   // fcb may point to kernel space, but stack is switched
1515 >        uint32 type, creator;   // BeOS: fcb may point to kernel space, but stack is switched
1516          get_finder_type(full_path, type, creator);
1517          WriteMacInt32(fcb + fcbFType, type);
1518          WriteMacInt32(fcb + fcbCatPos, fd);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines