]> andersk Git - moira.git/blobdiff - lib/mr_connect.c
don't clobber error code before loggin it.
[moira.git] / lib / mr_connect.c
index f701aac9ad965d361e4c4b215c7411a188aed16f..ab0da959a32a43ef661b6af809611ab570d2fb71 100644 (file)
@@ -4,22 +4,26 @@
  *     $Header$
  *
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
+ *     For copying and distribution information, please see the file
+ *     <mit-copyright.h>.
  *     
  *     This routine is part of the client library.  It handles
- * creating a connection to the sms server.
+ *     creating a connection to the sms server.
  */
 
 #ifndef lint
 static char *rcsid_sms_connect_c = "$Header$";
 #endif lint
 
+#include <mit-copyright.h>
 #include "sms_private.h"
 
 /*
  * Open a connection to the sms server.
  */
 
-int sms_connect()
+int sms_connect(server)
+char *server;
 {
     extern int errno;
        
@@ -31,7 +35,9 @@ int sms_connect()
      * number/name.
      */
     errno = 0;
-    _sms_conn = start_server_connection(SMS_GDB_SERV, ""); 
+    if (!server || (strlen(server) == 0))
+      server = SMS_GDB_SERV;
+    _sms_conn = start_server_connection(server, ""); 
     if (_sms_conn == NULL)
        return errno;
     if (connection_status(_sms_conn) == CON_STOPPED) {
@@ -72,14 +78,3 @@ int sms_noop()
 
     return status;
 }
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
This page took 0.032733 seconds and 4 git commands to generate.