/* * Find out device-mapper's major version number the first time * this is called and whether or not we support it. */ int dm_check_version(void) { char libversion[64], dmversion[64]; const char *compat = ""; if (_version_checked) return _version_ok; _version_checked = 1; if (_check_version(dmversion, sizeof(dmversion), _dm_compat)) return 1; if (!_dm_compat) goto bad; log_verbose("device-mapper ioctl protocol version %u failed. " "Trying protocol version 1.", _dm_version); _dm_version = 1; if (_check_version(dmversion, sizeof(dmversion), 0)) { log_verbose("Using device-mapper ioctl protocol version 1"); return 1; } compat = "(compat)"; dm_get_library_version(libversion, sizeof(libversion)); log_error("Incompatible libdevmapper %s%s and kernel driver %s", libversion, compat, dmversion); bad: _version_ok = 0; return 0; }
/* * Find out device-mapper's major version number the first time * this is called and whether or not we support it. */ int dm_check_version(void) { char dmversion[64]; if (_version_checked) return _version_ok; _version_checked = 1; if (_check_version(dmversion, sizeof(dmversion))) return 1; return 0; }