rsync 2.5.5 SCO Unixware patch

Stephen Friedl steve at unixwiz.net
Mon Dec 23 22:15:03 EST 2002


Hello list,

This is a patch to rsync 2.5.5, and it serves two purposes. The small
patches to batch.c, flist.c and log.c simply add "void" to some function
definitions so that all declarations in proto.h have full parameter lists.

	unsigned char read_batch_flags()	OLD
	unsigned char read_batch_flags(void)	NEW

The SCO UNIXWare compiler correctly objected to these functions not
having a prototype in scope. The fix seems to be innocuous and should
not break anything. It does seem to require a "make proto" afterwards
to rebuild proto.h

The change in popt/popt.c is to work around a bug in the SCO UNIXWare 8
compiler: it doesn't properly deal with alloca() being called from the
middle of another function call. The code dumps badly on this platform
with all modes (debug, regular, optimized), and the workaround shown
gets around the bug and likely obviates similar bugs on other platforms.

	Steve Friedl / steve at unixwiz.net / www.unixwiz.net
	23 December 2002

--- 
Stephen J Friedl | Software Consultant | Tustin, CA |   +1 714 544-6561
www.unixwiz.net  | I speak for me only |   KA8CMY   | steve at unixwiz.net


--- batch.c.orig	Mon Dec 23 21:51:23 2002
+++ batch.c	Mon Dec 23 21:51:28 2002
@@ -264,7 +264,7 @@
 	return bytes_read;
 }
 
-unsigned char read_batch_flags()
+unsigned char read_batch_flags(void)
 {
 	int flags;
 
--- flist.c.orig	Mon Dec 23 21:51:31 2002
+++ flist.c	Mon Dec 23 21:51:43 2002
@@ -1177,7 +1177,7 @@
 /*
  * allocate a new file list
  */
-struct file_list *flist_new()
+struct file_list *flist_new(void)
 {
 	struct file_list *flist;
 
--- log.c.orig	Mon Dec 23 21:51:47 2002
+++ log.c	Mon Dec 23 21:51:54 2002
@@ -183,7 +183,7 @@
 #endif
 }
 
-void log_open()
+void log_open(void)
 {
 	if (logfname && !logfile) {
 		extern int orig_umask;
@@ -193,7 +193,7 @@
 	}
 }
 
-void log_close()
+void log_close(void)
 {
 	if (logfile) {
 		fclose(logfile);
--- popt/popt.c.orig	Mon Dec 23 21:51:59 2002
+++ popt/popt.c	Mon Dec 23 21:59:21 2002
@@ -443,9 +443,10 @@
 	    }
 
 	    /* Make a copy we can hack at */
-	    localOptString = optString =
-			strcpy(ALLOCA(strlen(origOptString) + 1),
-			origOptString);
+	    { int n = strlen(origOptString) + 1;
+	      localOptString = optString = ALLOCA(n);
+	      strcpy(optString, origOptString);
+	    }
 
 	    if (!optString[0])
 		return POPT_ERROR_BADOPT;




More information about the rsync mailing list