]> andersk Git - moira.git/blobdiff - update/client.c
added palladium
[moira.git] / update / client.c
index 709d1f9de5091ba361c3f76eec82f998cd83a5c9..0019c121cf938ead9d569408b39fcc9c95965a5a 100644 (file)
@@ -10,7 +10,9 @@ static char *rcsid_client2_c = "$Header$";
 /*
  * MODULE IDENTIFICATION:
  *     $Header$
- *     Copyright 1987 MIT Project Athena.
+ *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     For copying and distribution information, please see the file
+ *     <mit-copyright.h>.
  * DESCRIPTION:
  *     This code handles the actual distribution of data files
  *     to servers in the SMS server-update program.
@@ -22,11 +24,13 @@ static char *rcsid_client2_c = "$Header$";
  *     sms_update_server
  */
 
+#include <mit-copyright.h>
 #include <stdio.h>
 #include <strings.h>
 #include <gdb.h>
 #include <sys/param.h>
 #include <sys/wait.h>
+#include <sys/socket.h>
 #include <update.h>
 #include <errno.h>
 #include <dcm.h>
@@ -34,7 +38,7 @@ static char *rcsid_client2_c = "$Header$";
 #include <krb.h>
 
 extern char *malloc();
-extern int errno;
+extern int errno, dbg;
 
 static char buf[BUFSIZ];
 static int code;
@@ -53,7 +57,7 @@ CONNECTION conn;
  * RETURN VALUE:
  *     void
  * SIDE EFFECTS:
- *     Initializes GDB library and SMSU error table.
+ *     Initializes GDB library.
  * PROBLEMS:
  *
  */
@@ -64,7 +68,6 @@ initialize()
 
     if (!initialized) {
        gdb_init();
-       init_smsU_err_tbl();
        initialized++;
     }
 }
@@ -110,6 +113,7 @@ char *instructions;
     (((str) != (char *)NULL) && (strlen(str) != 0))
 
     char *service_address, *service_updated, *pathname;
+    int on;
     
     /* some sanity checking of arguments while we build data */
     ASSERT(NONNULL(machine), SMS_INTERNAL, " null host name");
@@ -146,6 +150,8 @@ char *instructions;
                " can't connect to update %s", service_address);
        return(SMS_CANT_CONNECT);
     }
+    on = 1;
+    setsockopt(conn->in.fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
     
     /* send authenticators */
     code = send_auth(machine);
@@ -234,7 +240,7 @@ static
 execute(path)
     char *path;
 {
-    union wait response;
+    int response;
     STRING data;
     register int code;
     
@@ -246,15 +252,10 @@ execute(path)
     code = receive_object(conn, (char *)&response, INTEGER_T);
     if (code)
        return(connection_errno(conn));
-    if (response.w_retcode) {
-/****************************************************************
- * The following line is there because the current update servers
- * don't return the correct error code when an update fails.  Remove
- * this line when they are fixed.  -mar  7/26/88
- ****************************************************************/
-       return(SMS_INTERNAL);
-/*     return(response.w_retcode); */
-    }
+    if (dbg & DBG_TRACE)
+      com_err(whoami, response, "execute returned %d", response);
+    if (response)
+      return(response);
     return(SMS_SUCCESS);
 }
 
This page took 0.070935 seconds and 4 git commands to generate.