Code

plugin: Make sdb_plugin_info_t public.
[sysdb.git] / src / tools / sysdbd / main.c
index 7dc9f26ba4b33bff7ab41a67996bedb34aa1a824..96fe6a645459d79aff04a4d13f7f6153b094d685 100644 (file)
@@ -236,7 +236,7 @@ main_loop(void)
 
        int status = 0;
 
-       while (42) {
+       while (status == 0) {
                size_t i;
 
                plugin_main_loop.do_loop = 1;
@@ -261,13 +261,12 @@ main_loop(void)
                }
 
                /* break on error */
-               if (i < listen_addresses_num) {
-                       status = 1;
+               if (status)
                        break;
-               }
 
                sdb_log(SDB_LOG_INFO, "SysDB daemon "SDB_VERSION_STRING
-                               SDB_VERSION_EXTRA " (pid %i) initialized successfully",
+                               SDB_VERSION_EXTRA " (libsysdb %s%s, pid %i) initialized "
+                               "successfully", sdb_version_string(), sdb_version_extra(),
                                (int)getpid());
 
                sdb_connection_enable_logging();
@@ -293,6 +292,8 @@ main_loop(void)
        }
 
        /* clean up in case we exited the loop on error */
+       plugin_main_loop.do_loop = 0;
+       frontend_main_loop.do_loop = 0;
        pthread_kill(backend_thread, SIGINT);
        pthread_join(backend_thread, NULL);