freelance-updates-20011031
[openafs.git] / src / update / client.c
index b38fc65..9ec65f3 100644 (file)
@@ -7,8 +7,11 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#include <afs/param.h>
 #include <afsconfig.h>
+#include <afs/param.h>
+
+RCSID("$Header$");
+
 #include <afs/stds.h>
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #include <sys/time.h>
 #include <dirent.h>
 #endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
 #ifdef HAVE_STRING_H
 #include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
 #endif
 #endif
 #ifdef HAVE_UNISTD_H
 #include <afs/cellconfig.h>
 #include <afs/afsutil.h>
 #include <afs/fileutil.h>
-
-RCSID("$Header$");
-
 #include "update.h"
 #include "global.h"
 
-
 char *whoami;
 static int verbose;
 
@@ -78,7 +77,7 @@ char *aname; {
        printf("host %s not found \n", aname);
        exit(1);
     }
-    bcopy(th->h_addr, &addr, sizeof(addr));
+    memcpy(&addr, th->h_addr, sizeof(addr));
     return addr;
 }
 
@@ -315,8 +314,11 @@ again:
                                                  mode, atime, time);
                    if (errcode == 1) /* this file failed, but keep trying */
                      goto fail_dirbuf;  
-                   if (errcode == -1) /* time to quit */
+                   if (errcode == -1) /* time to quit */ {
+                     fclose(stream);
+                     unlink(dirbuf);
                      return -1;
+                   }
                }
 
            }