]> andersk Git - moira.git/blobdiff - lib/mr_connect.c
Initial revision
[moira.git] / lib / mr_connect.c
index 1cda2e8504c10e737400ab8036466d26c1c72736..b86ec892579752d3cac55facaf53ad3078f5cd7d 100644 (file)
@@ -27,14 +27,17 @@ int sms_connect()
     if (_sms_conn) return SMS_ALREADY_CONNECTED;
                
     /* 
-     *         * should do a hesiod call to find the sms machine name & service
-     *          * number/name.
-     *          */
-    /* XXX gdb doesn't give real return codes. Can we trust errno?*/
+     * XXX should do a hesiod call to find the sms machine name & service
+     * number/name.
+     */
     errno = 0;
     _sms_conn = start_server_connection(SMS_GDB_SERV, ""); 
-    if (_sms_conn == NULL) {
+    if (_sms_conn == NULL)
        return errno;
+    if (connection_status(_sms_conn) == CON_STOPPED) {
+       register status = connection_errno(_sms_conn);
+       sms_disconnect();
+       return status;
     }
     return 0;
 }
This page took 0.025202 seconds and 4 git commands to generate.