static int get_key_or_die(const char *config_file)
{
- int ret;
- struct stat statbuf;
- char *rpath;
-
assert(config_file);
- if (stat(config_file, &statbuf) == 0) {
- rpath = realpath(config_file, NULL);
- if (!rpath) {
- DSS_EMERG_LOG(("could not resolve path %s: %m\n", config_file));
- exit(EXIT_FAILURE);
- }
- DSS_DEBUG_LOG(("resolved path: %s\n", rpath));
- } else
- /*
- * This happens if the user did not specify a config file, and
- * the default config file does not exist. Another (unlikely)
- * possibility is that the config file was removed between
- * startup and this call. We don't care about these corner
- * cases too much and just use the unresolved path in this
- * case.
- */
- rpath = dss_strdup(config_file);
- ret = super_fast_hash((uint8_t *)rpath, strlen(rpath), 0) >> 1;
- free(rpath);
- return ret;
+ return super_fast_hash((uint8_t *)config_file, strlen(config_file), 0) >> 1;
}
static int mutex_get(key_t key, int flags)