Got rid of zlib/dummy ("dummy" is in the zlib .cvsignore, where it
[rsync/rsync.git] / generator.c
index 0a9d3f5..453c6e0 100644 (file)
@@ -43,7 +43,6 @@ extern int protocol_version;
 extern int always_checksum;
 extern char *compare_dest;
 extern int link_dest;
-extern struct file_struct **hlink_list;
 
 
 /* choose whether to skip a particular file */
@@ -54,7 +53,7 @@ static int skip_file(char *fname, struct file_struct *file, STRUCT_STAT *st)
        }
        if (link_dest) {
                if (preserve_perms
-                   && (st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT))
+                   && (st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS))
                        return 0;
 
                if (am_root && preserve_uid && st->st_uid != file->uid)
@@ -102,7 +101,7 @@ void write_sum_head(int f, struct sum_struct *sum)
 {
        static struct sum_struct null_sum;
 
-       if (sum == (struct sum_struct *)NULL)
+       if (sum == NULL)
                sum = &null_sum;
 
        write_int(f, sum->count);
@@ -296,7 +295,8 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
                /* if the file exists already and we aren't perserving
                 * permissions then act as though the remote end sent
                 * us the file permissions we already have */
-               file->mode = (file->mode & _S_IFMT) | (st.st_mode & ~_S_IFMT);
+               file->mode = (file->mode & ~CHMOD_BITS)
+                          | (st.st_mode & CHMOD_BITS);
        }
 
        if (S_ISDIR(file->mode)) {
@@ -378,7 +378,7 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
        if (am_root && preserve_devices && IS_DEVICE(file->mode)) {
                if (statret != 0 ||
                    st.st_mode != file->mode ||
-                   (DEV64_T)st.st_rdev != file->u.rdev) {
+                   st.st_rdev != file->u.rdev) {
                        delete_file(fname);
                        if (verbose > 2)
                                rprintf(FINFO,"mknod(%s,0%o,0x%x)\n",
@@ -408,7 +408,7 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
 
        fnamecmp = fname;
 
-       if ((statret == -1) && (compare_dest != NULL)) {
+       if (statret == -1 && compare_dest != NULL) {
                /* try the file at compare_dest instead */
                int saveerrno = errno;
                pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);
@@ -530,9 +530,10 @@ void generate_files(int f, struct file_list *flist, char *local_name)
        int phase=0;
        char fbuf[MAXPATHLEN];
 
-       if (verbose > 2)
-               rprintf(FINFO,"generator starting pid=%d count=%d\n",
-                       (int)getpid(),flist->count);
+       if (verbose > 2) {
+               rprintf(FINFO, "generator starting pid=%ld count=%d\n",
+                       (long)getpid(), flist->count);
+       }
 
        if (verbose >= 2) {
                rprintf(FINFO,