]> the.earth.li Git - onak.git/blobdiff - keydb_keyd.c
Fix compilation breakage with PostgreSQL backend
[onak.git] / keydb_keyd.c
index fec6ebbc6afd3dc8751eb97ea4ea158d113db726..6836e9a2db02cbbe28d22b1a123a2103ee56da05 100644 (file)
@@ -502,7 +502,7 @@ static void keyd_cleanupdb(struct onak_dbctx *dbctx)
  *     this file are called in order to allow the DB to be initialized ready
  *     for access.
  */
-struct onak_dbctx *keydb_keyd_init(bool readonly)
+struct onak_dbctx *keydb_keyd_init(struct onak_db_config *dbcfg, bool readonly)
 {
        struct sockaddr_un sock;
        uint32_t           cmd = KEYD_CMD_UNKNOWN;
@@ -515,6 +515,7 @@ struct onak_dbctx *keydb_keyd_init(bool readonly)
        if (dbctx == NULL) {
                return NULL;
        }
+       dbctx->config = dbcfg;
 
        keyd_fd = socket(PF_UNIX, SOCK_STREAM, 0);
        if (keyd_fd < 0) {
@@ -527,7 +528,7 @@ struct onak_dbctx *keydb_keyd_init(bool readonly)
 
        sock.sun_family = AF_UNIX;
        snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
-                       config.db_dir,
+                       config.sock_dir,
                        KEYD_SOCKET);
        if (connect(keyd_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
                logthing(LOGTHING_CRITICAL,