diff options
author | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2001-12-02 21:54:10 +0000 |
---|---|---|
committer | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2001-12-02 21:54:10 +0000 |
commit | 6452587524f1fd1b2551642992114010afb51f36 (patch) | |
tree | c8de17de2df8d3987e655647c93aec1b08aa2581 /net/dctc/files/patch-src:db.c | |
parent | cfaf7af6f070d11f23a60754df078bb531aa97c5 (diff) | |
download | ports-6452587524f1fd1b2551642992114010afb51f36.tar.gz ports-6452587524f1fd1b2551642992114010afb51f36.zip |
Notes
Diffstat (limited to 'net/dctc/files/patch-src:db.c')
-rw-r--r-- | net/dctc/files/patch-src:db.c | 66 |
1 files changed, 4 insertions, 62 deletions
diff --git a/net/dctc/files/patch-src:db.c b/net/dctc/files/patch-src:db.c index 74abd7eca69b..e2d61a5d4ddb 100644 --- a/net/dctc/files/patch-src:db.c +++ b/net/dctc/files/patch-src:db.c @@ -1,69 +1,11 @@ ---- src/db.c.orig Thu Nov 22 00:08:34 2001 -+++ src/db.c Thu Nov 22 00:11:49 2001 -@@ -30,6 +30,15 @@ +--- src/db.c Mon Nov 26 16:28:32 2001 ++++ src/db.c Sun Dec 2 19:34:12 2001 +@@ -30,6 +30,8 @@ #include <netinet/in.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" + #include "db.h" #include "display.h" #include "var.h" -@@ -711,6 +720,9 @@ - /******************************************************************************************/ - static void send_a_db_result(int output_sck, char *dest_nick, DB_ENTRY *de, struct sockaddr_in *dest_addr, char *md5sum) - { -+#if (defined(BSD) && (BSD >= 199103)) -+ sigset_t sigset, sigoset; -+#endif - GString *str; - GString *adapted; - -@@ -752,10 +764,38 @@ - printf("dest_addr: %s, str: %s\n",dest_addr,str->str); - #endif - -- if(dest_addr==NULL) -+ if(dest_addr==NULL) { -+#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(output_sck,str->str,str->len,MSG_NOSIGNAL); -- else -+#if (defined(BSD) && (BSD >= 199103)) -+ /* restore sigmask backup */ -+ (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); -+#endif -+ } else { -+#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 - sendto(output_sck,str->str,str->len,MSG_NOSIGNAL,(void*)dest_addr, sizeof(struct sockaddr_in)); -+ -+#if (defined(BSD) && (BSD >= 199103)) -+ /* restore sigmask backup */ -+ (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); -+#endif -+ } - - disp_msg(INFO_MSG,"send_search_result_line",str->str,NULL); - |