X-Git-Url: https://git.saurik.com/apple/hfs.git/blobdiff_plain/51e135ce018217de5c809f4ac236ef6b6d87ef97..HEAD:/fsck_hfs/dfalib/SControl.c diff --git a/fsck_hfs/dfalib/SControl.c b/fsck_hfs/dfalib/SControl.c index 5c654b9..43b2eda 100644 --- a/fsck_hfs/dfalib/SControl.c +++ b/fsck_hfs/dfalib/SControl.c @@ -494,7 +494,21 @@ termScav: if ( fsckGetVerbosity(dataArea.context) >= kDebugLog && (err != noErr || dataArea.RepLevel != repairLevelNoProblemsFound) ) PrintVolumeObject(); - + if (err != 0 && embedded == 1) { + Buf_t *buf = NULL; + off_t offset = 1024; + uint32_t len = 512; // the size of an HFS+ volume header + int rv = CacheRead(&fscache, offset, len, &buf); + if (rv == 0) { + fprintf(stderr, "Offset %llu length %u:\n", offset, len); + DumpData(buf->Buffer, len, NULL); + CacheRelease(&fscache, buf, 0); + } else { + fprintf(stderr, "%s(%d): rv = %d\n", __FUNCTION__, __LINE__, rv); + } + fflush(stderr); + } + // If we have write access on volume and we are allowed to write, // mark the volume clean/dirty if ((fsWriteRef != -1) && (dataArea.canWrite != 0)) { @@ -1335,7 +1349,7 @@ static int ScavSetUp( SGlob *GPtr) InitializeVolumeObject( GPtr ); /* Check if the volume type of initialized object is valid. If not, return error */ - if (VolumeObjectIsValid() == false) { + if (VolumeObjectIsValid(GPtr) == false) { return (R_BadSig); }