]> git.tuebingen.mpg.de Git - dss.git/blobdiff - ipc.c
Resolve config file path only once.
[dss.git] / ipc.c
diff --git a/ipc.c b/ipc.c
index 4aef302604cb1d80c65839148ece4372d48f6f99..2ccd156abb283a8cc0c7eeb33750edd6bc8da60b 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -80,31 +80,8 @@ static uint32_t super_fast_hash(const uint8_t *data, uint32_t len, uint32_t hash
 
 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)