OK, we can now get phase messages if we fail in send_file_entry
authorMartin Pool <mbp@samba.org>
Tue, 9 Apr 2002 04:50:25 +0000 (04:50 +0000)
committerMartin Pool <mbp@samba.org>
Tue, 9 Apr 2002 04:50:25 +0000 (04:50 +0000)
flist.c
io.c
rsync.h

diff --git a/flist.c b/flist.c
index 381eb8e..5fde5b6 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -354,6 +354,8 @@ static void send_file_entry(struct file_struct *file, int f,
                return;
        }
 
+       io_write_phase = "send_file_entry";
+
        fname = f_name(file);
 
        flags = base_flags;
@@ -449,6 +451,8 @@ static void send_file_entry(struct file_struct *file, int f,
 
        strlcpy(lastname, fname, MAXPATHLEN);
        lastname[MAXPATHLEN - 1] = 0;
+
+       io_write_phase = "unknown";
 }
 
 
diff --git a/io.c b/io.c
index 4591f69..a83276d 100644 (file)
--- a/io.c
+++ b/io.c
@@ -57,8 +57,12 @@ extern struct stats stats;
  * remote instance crashed.  Just giving the offset on the stream is
  * not very helpful.  So instead we try to make io_phase_name point to
  * something useful.
+ *
+ * @todo Perhaps we want some simple stack functionality, but there's
+ * no need to overdo it.
  **/
-const char *io_phase_name = "unknown";
+const char *io_write_phase = "unknown";
+const char *io_read_phase = "unknown";
 
 
 /** Ignore EOF errors while reading a module listing if the remote
@@ -501,7 +505,7 @@ static void writefd_unbuffered(int fd,char *buf,size_t len)
                                io_multiplexing_close();
                                rprintf(FERROR, RSYNC_NAME
                                        ": writefd_unbuffered failed to write %ld bytes: phase \"%s\": %s\n",
-                                       (long) len, io_phase_name, 
+                                       (long) len, io_write_phase, 
                                        strerror(errno));
                                exit_cleanup(RERR_STREAMIO);
                        }
diff --git a/rsync.h b/rsync.h
index eb89f64..2e92e2f 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -622,3 +622,5 @@ const char *get_panic_action(void);
 #endif
 
 #define UNUSED(x) x __attribute__((__unused__))
+
+const char *io_write_phase, *io_read_phase;