bool is_squashfuse_mounted()

in xar/XarExecFuse.cpp [139:157]


bool is_squashfuse_mounted(const std::string& path, bool try_fix) {
  struct statfs statfs_buf;
  if (statfs(path.c_str(), &statfs_buf) != 0) {
    if (!try_fix) {
      return false;
    }
    if (errno == ENOTCONN || errno == ECONNABORTED) {
      std::string cmd = tools::xar::UNMOUNT_CMD + path;
      if (system(cmd.c_str()) != 0) {
        XAR_FATAL << "unable to umount broken mount; try 'fusermount -u "
                  << path << "' by hand";
      }
      return false;
    }
    XAR_FATAL << "statfs failed for " << path << ": " << strerror(errno);
  }

  return tools::xar::is_squashfs_mounted(statfs_buf);
}