]> andersk Git - moira.git/blobdiff - update/client.c
added palladium
[moira.git] / update / client.c
index d7960cddbaf7c9d15e4da8e1e4c27bfa6731158b..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>
@@ -109,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");
@@ -145,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);
@@ -233,7 +240,7 @@ static
 execute(path)
     char *path;
 {
-    union wait response;
+    int response;
     STRING data;
     register int code;
     
@@ -246,17 +253,9 @@ execute(path)
     if (code)
        return(connection_errno(conn));
     if (dbg & DBG_TRACE)
-      com_err(whoami, 0, "execute returned %x (%d)",
-             response, response.w_retcode);
-    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); */
-    }
+      com_err(whoami, response, "execute returned %d", response);
+    if (response)
+      return(response);
     return(SMS_SUCCESS);
 }
 
This page took 0.041289 seconds and 4 git commands to generate.