Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > 8104c6e5600a8fbbbb44d47f9febbc59 > files > 31

krb5-1.6.1-25.el5.src.rpm

If our attempt to create or write to a file fails, signal to the other end that
it should skip on to the next file instead of just sitting there indefinitely
waiting for a go-ahead from us.

--- krb5-1.3.4/src/appl/bsd/krcp.c	2007-02-07 13:32:19.000000000 +0000
+++ krb5-1.3.4/src/appl/bsd/krcp.c	2007-02-07 13:34:03.000000000 +0000
@@ -142,6 +142,8 @@ void 	error (char *fmt, ...)
      ;
 
 #define	ga()	 	(void) rcmd_stream_write(rem, "", 1, 0)
+#define	skip_file()	(void) rcmd_stream_write(rem, "\001\n", 2, 0)
+#define	abort_xfer()	(void) rcmd_stream_write(rem, "\002\n", 2, 0)
 
 int main(argc, argv)
      int argc;
@@ -1142,6 +1144,7 @@ void sink(argc, argv)
 	if ((of = open(nambuf, O_WRONLY|O_CREAT, mode)) < 0) {
 	  bad:
 	    error("rcp: %s: %s\n", nambuf, error_message(errno));
+	    skip_file();
 	    continue;
 	}
 	if (exists && pflag) {
@@ -1197,9 +1200,10 @@ void sink(argc, argv)
 	      error("rcp: can't set times on %s: %s\n",
 		    nambuf, error_message(errno));
 	}				   
-	if (wrerr)
+	if (wrerr) {
 	  error("rcp: %s: %s\n", nambuf, error_message(errno));
-	else
+	  skip_file();
+	} else
 	  ga();
     }
   screwup: