diff options
Diffstat (limited to 'net/dctc/files/patch-src:dc_com.c')
-rw-r--r-- | net/dctc/files/patch-src:dc_com.c | 59 |
1 files changed, 9 insertions, 50 deletions
diff --git a/net/dctc/files/patch-src:dc_com.c b/net/dctc/files/patch-src:dc_com.c index 087695791f12..1472eac54753 100644 --- a/net/dctc/files/patch-src:dc_com.c +++ b/net/dctc/files/patch-src:dc_com.c @@ -1,52 +1,11 @@ ---- src/dc_com.c.orig Thu Nov 22 00:12:50 2001 -+++ src/dc_com.c Thu Nov 22 00:15:55 2001 -@@ -33,6 +33,15 @@ - #include "main.h" - #include "var.h" +--- src/dc_com.c Sat Oct 20 03:46:54 2001 ++++ src/dc_com.c Sun Dec 2 19:34:12 2001 +@@ -28,6 +28,8 @@ + #include <errno.h> + #include <glib.h> -+#if (defined(__unix__) || defined(unix)) && !defined(USG) -+#include <sys/param.h> -+#endif -+ -+#if (defined(BSD) && (BSD >= 199103)) -+#include <signal.h> -+#define MSG_NOSIGNAL 0 -+#endif ++#include "config.h" + - char last_cmd[5120]; /* contains the first string of the last send_dc_line call */ - /* mainly used for debug features. */ - time_t last_cmd_time; -@@ -50,6 +59,10 @@ - /***********************************************************/ - void send_dc_line(int sck,...) - { -+#if (defined(BSD) && (BSD >= 199103)) -+ sigset_t sigset, sigoset; -+ ssize_t send_return; -+#endif - va_list ap; - char *t; - int have=0; -@@ -84,7 +97,21 @@ - - if((str->len)&&(cnx_in_progress==0)) - { -- if(send(sck,str->str,str->len,MSG_NOSIGNAL)!=str->len) -+#if (defined(BSD) && (BSD >= 199103)) -+ /* possible race condition since backup and restore -+ are not guaranteed to occur as a single operation */ -+ -+ /* backup sigmask and block SIGPIPE */ -+ sigemptyset(&sigset); -+ sigaddset(&sigset,SIGPIPE); -+ (void) sigprocmask(SIG_BLOCK, &sigset, &sigoset); -+#endif -+ send_return = send(sck,str->str,str->len, MSG_NOSIGNAL); -+#if (defined(BSD) && (BSD >= 199103)) -+ /* restore sigmask backup */ -+ (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); -+#endif -+ if(send_return!=str->len) - { - /* abort network operation on this socket */ - /* this will either generated a hub_disconnection message (main thread) */ + #include "dc_com.h" + #include "display.h" + #include "main.h" |