X-Git-Url: https://git.saurik.com/apple/hfs.git/blobdiff_plain/41dcebd9dbc8544645cb2f11dbddca553bffd7dd..ec99dd3007e7873c4585ff2dde91ee4d9b7e9da9:/CopyHFSMeta/util.c?ds=sidebyside diff --git a/CopyHFSMeta/util.c b/CopyHFSMeta/util.c index d90f7de..c7f4449 100644 --- a/CopyHFSMeta/util.c +++ b/CopyHFSMeta/util.c @@ -91,8 +91,8 @@ OpenDevice(const char *devname, int flushJournal) } else { errx(kBadExit, "device name `%s' does not fit pattern", devname); } - // Only use an exclusive open if we're not debugging. - fd = open(dev.devname, O_RDONLY | (debug ? 0 : O_EXLOCK)); + // Open with a shared lock if we're not debugging, since the hfs estimator api is invoked from the booted system + fd = open(dev.devname, O_RDONLY | (debug ? 0 : O_SHLOCK)); if (fd == -1) { err(kBadExit, "cannot open raw device %s", dev.devname); }