patch to use pipe if socketpair fails

Harri J{rvi
Thu, 24 Jul 2003 20:22:58 -0000

Hi,

if socketpair support has been compiled in but the host where rsync is run
doesn't support it, you get error
pipe failed in do_recv

This patch makes rsync use pipe if socketpair fails.

Yours,
Harri J?rvi

CC me if you reply to this thread since I'm not on the mailing list
-------------- next part --------------
--- rsync-2.5.5/util.c	Wed Mar 20 03:09:49 2002
+++ util.c	Thu Jul 24 13:11:45 2003
@@ -71,6 +71,10 @@

 #if HAVE_SOCKETPAIR
 	ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
+        if (ret != 0) {
+            perror("socketpair failed. trying pipe");
+            ret = pipe(fd);
+        }
 #else
 	ret = pipe(fd);
 #endif