minor bugfixes
authorPaul Mackerras <paulus@samba.org>
Fri, 11 Apr 1997 06:18:02 +0000 (06:18 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 11 Apr 1997 06:18:02 +0000 (06:18 +0000)
lib/zlib.c
main.c
rsync.c

index 9d96513..82e82c7 100644 (file)
@@ -3943,7 +3943,9 @@ z_stream *z;            /* for zfree function */
 
 
 /* build fixed tables only once--keep them here */
-local int fixed_lock = 0;
+#ifdef MULTI_THREADED
+local volatile int fixed_lock = 0;
+#endif
 local int fixed_built = 0;
 #define FIXEDH 530      /* number of hufts used by fixed tables */
 local uInt fixed_left = FIXEDH;
@@ -3984,8 +3986,10 @@ inflate_huft * FAR *tl;  /* literal/length tree result */
 inflate_huft * FAR *td;  /* distance tree result */
 {
   /* build fixed tables if not built already--lock out other instances */
+#ifdef MULTI_THREADED
   while (++fixed_lock > 1)
     fixed_lock--;
+#endif
   if (!fixed_built)
   {
     int k;              /* temporary variable */
@@ -4018,7 +4022,9 @@ inflate_huft * FAR *td;  /* distance tree result */
     /* done */
     fixed_built = 1;
   }
+#ifdef MULTI_THREADED
   fixed_lock--;
+#endif
   *bl = fixed_bl;
   *bd = fixed_bd;
   *tl = fixed_tl;
diff --git a/main.c b/main.c
index 3cbf5f8..936fdb9 100644 (file)
--- a/main.c
+++ b/main.c
@@ -468,7 +468,7 @@ static struct option long_options[] = {
 
 int main(int argc,char *argv[])
 {
-    int pid, status, status2;
+    int pid, status = 0, status2 = 0;
     int opt;
     int option_index;
     char *shell_cmd = NULL;
diff --git a/rsync.c b/rsync.c
index b19681c..77ad9d7 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -535,7 +535,7 @@ static void delete_files(struct file_list *flist)
   if (!(local_file_list = send_file_list(-1,1,&dot)))
     return;
 
-  for (i=local_file_list->count;i>=0;i--) {
+  for (i=local_file_list->count-1;i>=0;i--) {
     if (!local_file_list->files[i].name) continue;
     if (-1 == flist_find(flist,&local_file_list->files[i])) {
       delete_one(&local_file_list->files[i]);