diff options
author | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2001-11-25 20:57:08 +0000 |
---|---|---|
committer | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2001-11-25 20:57:08 +0000 |
commit | b7975676dad1eae61753ae11376a2c83e0844de8 (patch) | |
tree | 30e81c7667cc8d01defeba1bad42b230251dcfa7 /net-p2p/dctc | |
parent | d90f4b1e1ccf007b8b7e2871b3df29f7a63bb8a4 (diff) | |
download | ports-b7975676dad1eae61753ae11376a2c83e0844de8.tar.gz ports-b7975676dad1eae61753ae11376a2c83e0844de8.zip |
Notes
Diffstat (limited to 'net-p2p/dctc')
-rw-r--r-- | net-p2p/dctc/Makefile | 6 | ||||
-rw-r--r-- | net-p2p/dctc/distinfo | 2 | ||||
-rw-r--r-- | net-p2p/dctc/files/patch-src:Makefile | 10 | ||||
-rw-r--r-- | net-p2p/dctc/files/patch-src:dc_manage.c | 74 | ||||
-rw-r--r-- | net-p2p/dctc/files/patch-src:keyboard.c | 18 | ||||
-rw-r--r-- | net-p2p/dctc/files/patch-src:main.c | 27 | ||||
-rw-r--r-- | net-p2p/dctc/files/patch-src:sema.c | 31 |
7 files changed, 122 insertions, 46 deletions
diff --git a/net-p2p/dctc/Makefile b/net-p2p/dctc/Makefile index 03e3ae25e460..7dee84227c12 100644 --- a/net-p2p/dctc/Makefile +++ b/net-p2p/dctc/Makefile @@ -6,7 +6,7 @@ # PORTNAME= dctc -PORTVERSION= 0.59 +PORTVERSION= 0.60 CATEGORIES= net MASTER_SITES= http://ac2i.tzo.com/dctc/ DISTNAME= ${PORTNAME}_v${PORTVERSION} @@ -20,7 +20,9 @@ USE_GLIB= yes NO_WRKSUBDIR= yes BUILD_WRKSRC= ${WRKSRC}/src MAKE_ENV= CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib -lgnugetopt" + LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib -lgnugetopt" \ + PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ + PTHREAD_LIBS=${PTHREAD_LIBS} ALL_TARGET= DOC_FILES= COPYING ChangeLog INSTALL README \ diff --git a/net-p2p/dctc/distinfo b/net-p2p/dctc/distinfo index 6d4eddf0ac7a..3fc1de8c3a05 100644 --- a/net-p2p/dctc/distinfo +++ b/net-p2p/dctc/distinfo @@ -1 +1 @@ -MD5 (dctc_v0.59.tar.gz) = 265848e9c73eca6837d8012862ab386e +MD5 (dctc_v0.60.tar.gz) = 0fe566ab242528833a5640cfb5a74257 diff --git a/net-p2p/dctc/files/patch-src:Makefile b/net-p2p/dctc/files/patch-src:Makefile index 1d588ba4f810..2a629e5d672c 100644 --- a/net-p2p/dctc/files/patch-src:Makefile +++ b/net-p2p/dctc/files/patch-src:Makefile @@ -1,13 +1,13 @@ ---- src/Makefile.orig Thu Nov 22 02:16:36 2001 -+++ src/Makefile Thu Nov 22 02:17:21 2001 +--- src/Makefile.orig Sat Nov 24 13:20:21 2001 ++++ src/Makefile Sat Nov 24 13:20:34 2001 @@ -1,6 +1,6 @@ #CC = gcc -CFLAGS =-g -march=i586 -O2 -Wall `glib-config --cflags glib gthread` -Wpointer-arith -Wcast-qual -Wwrite-strings #-Wshadow -LDFLAGS = -g `glib-config --libs glib gthread` -+CFLAGS +=-g -Wall `${GLIB_CONFIG} --cflags glib gthread` -Wpointer-arith -Wcast-qual -Wwrite-strings -I${LOCALBASE}/include -+LDFLAGS += -g `${GLIB_CONFIG} --libs glib gthread` ++CFLAGS +=-g -Wall `${GLIB_CONFIG} --cflags glib gthread` -Wpointer-arith -Wcast-qual -Wwrite-strings -I${LOCALBASE}/include ${PTHREAD_CFLAGS} ++LDFLAGS += -g `${GLIB_CONFIG} --libs glib gthread` ${PTHREAD_LIBS} - CSRC = main.c action.c dc_com.c display.c key.c keyboard.c network.c typical_action.c dc_manage.c db.c he3.c gts.c user_manage.c md.c timed_out_string.c + CSRC = main.c action.c dc_com.c display.c key.c keyboard.c network.c typical_action.c dc_manage.c db.c he3.c gts.c user_manage.c md.c timed_out_string.c sema.c @@ -15,7 +15,7 @@ $(CC) $(CFLAGS) $(LDFLAGS) $(COBJ) -o dctc diff --git a/net-p2p/dctc/files/patch-src:dc_manage.c b/net-p2p/dctc/files/patch-src:dc_manage.c index b33748a72845..247a503af09c 100644 --- a/net-p2p/dctc/files/patch-src:dc_manage.c +++ b/net-p2p/dctc/files/patch-src:dc_manage.c @@ -1,5 +1,5 @@ ---- src/dc_manage.c.orig Thu Nov 22 00:12:51 2001 -+++ src/dc_manage.c Thu Nov 22 00:13:13 2001 +--- src/dc_manage.c.orig Sat Nov 24 08:43:42 2001 ++++ src/dc_manage.c Sat Nov 24 13:17:32 2001 @@ -35,6 +35,11 @@ #include <fcntl.h> #include <pthread.h> @@ -12,7 +12,7 @@ #include "display.h" #include "action.h" #include "macro.h" -@@ -188,6 +193,9 @@ +@@ -189,6 +194,9 @@ /*************************/ static int send_file_data(int sck,char *filename, int start_pos, unsigned long file_len,WAIT_ACT *act) { @@ -20,12 +20,12 @@ + sigset_t sigset, sigoset; +#endif unsigned long int i; - char buf[8192]; + char buf[8192]; /* must be a multiple of 512 */ unsigned long int a=file_len-start_pos; -@@ -217,7 +225,20 @@ - goto abrt; - +@@ -220,7 +228,20 @@ act->last_touch=time(NULL); + + get_slices(bl_semid,sizeof(buf)/512); /* obtain upload authorization */ +#if (defined(BSD) && (BSD >= 199103)) + /* possible race condition since backup and restore + are not guaranteed to occur as a single operation */ @@ -40,14 +40,13 @@ + /* restore sigmask backup */ + (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); +#endif + act->last_touch=time(NULL); if(res!=sizeof(buf)) - goto abrt; -@@ -232,8 +253,20 @@ - res=fread(buf,1,remain,f); - if(res!=remain) /* read error ? */ - goto abrt; -- +@@ -240,7 +261,20 @@ + act->last_touch=time(NULL); + + get_slices(bl_semid,(remain+511)/512); /* obtain upload authorization */ +#if (defined(BSD) && (BSD >= 199103)) + /* possible race condition since backup and restore + are not guaranteed to occur as a single operation */ @@ -56,16 +55,16 @@ + sigemptyset(&sigset); + sigaddset(&sigset,SIGPIPE); + (void) sigprocmask(SIG_BLOCK, &sigset, &sigoset); -+#endif ++#endif res=send(sck,buf,remain,MSG_NOSIGNAL|MSG_WAITALL); +#if (defined(BSD) && (BSD >= 199103)) + /* restore sigmask backup */ + (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); +#endif + + act->last_touch=time(NULL); if(res!=remain) - goto abrt; - } -@@ -250,6 +283,9 @@ +@@ -259,6 +293,9 @@ /*************************/ static int send_array_data(int sck,GByteArray *ba,WAIT_ACT *act) { @@ -75,10 +74,10 @@ unsigned long int i; unsigned long int nb; int remain; -@@ -263,7 +299,20 @@ - for(i=0;i<nb;i++) - { +@@ -274,7 +311,20 @@ act->last_touch=time(NULL); + + get_slices(bl_semid,BLOCK_SIZE/512); /* obtain upload authorization */ +#if (defined(BSD) && (BSD >= 199103)) + /* possible race condition since backup and restore + are not guaranteed to occur as a single operation */ @@ -93,13 +92,13 @@ + /* restore sigmask backup */ + (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); +#endif + act->last_touch=time(NULL); if(res!=BLOCK_SIZE) - { -@@ -277,7 +326,20 @@ - disp_msg(DEBUG_MSG,"send_array_data","partial",NULL); - if(remain!=0) - { +@@ -292,7 +342,20 @@ + act->last_touch=time(NULL); + + get_slices(bl_semid,(remain+511)/512); /* obtain upload authorization */ +#if (defined(BSD) && (BSD >= 199103)) + /* possible race condition since backup and restore + are not guaranteed to occur as a single operation */ @@ -114,10 +113,10 @@ + /* restore sigmask backup */ + (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); +#endif + + act->last_touch=time(NULL); if(res!=remain) - goto abrt; - } -@@ -309,6 +371,9 @@ +@@ -326,6 +389,9 @@ /**************************************************************************/ static int com_up_get_list_len_process(const char *cmd,WAIT_ACT *act,int sck,GString *input, char *xtra_param) { @@ -127,11 +126,10 @@ GByteArray *cpy_data; GString *out; int res; -@@ -337,8 +402,20 @@ - g_string_sprintfa(out,"%lu|",(unsigned long)cpy_data->len); +@@ -377,7 +443,20 @@ + + disp_msg(DEBUG_MSG,"reply",out->str,NULL); - disp_msg(INFO_MSG,"reply",out->str,NULL); -- +#if (defined(BSD) && (BSD >= 199103)) + /* possible race condition since backup and restore + are not guaranteed to occur as a single operation */ @@ -149,7 +147,7 @@ res=(res!=out->len); g_string_free(out,TRUE); if(res) -@@ -362,7 +439,20 @@ +@@ -403,7 +482,20 @@ g_string_sprintfa(out,"%lu|",(unsigned long)100000+rand()%500000); else g_string_sprintfa(out,"%lu|",(unsigned long)cpy_data->len); @@ -170,7 +168,7 @@ res=(res!=out->len); g_string_free(out,TRUE); if(res) -@@ -643,6 +733,9 @@ +@@ -674,6 +766,9 @@ /*****************************************************************/ static int copie_fd_to_file(int remote, FILE *local, unsigned long amount,WAIT_ACT *act) { @@ -180,7 +178,7 @@ while(amount!=0) { char buf[8192]; -@@ -653,7 +746,20 @@ +@@ -684,7 +779,20 @@ /* touch the action slot to avoid timeout */ act->last_touch=time(NULL); @@ -201,7 +199,7 @@ act->last_touch=time(NULL); if((ret==-1)||(ret==0)) -@@ -983,6 +1089,9 @@ +@@ -1019,6 +1127,9 @@ /*****************************************************************/ static int copie_fd_to_bytearray(int remote, GByteArray **ba, unsigned long amount,WAIT_ACT *act) { @@ -211,7 +209,7 @@ int pos=0; int ret; unsigned long nb; -@@ -996,12 +1105,25 @@ +@@ -1032,12 +1143,25 @@ /* touch the action slot to avoid timeout */ act->last_touch=time(NULL); @@ -237,7 +235,7 @@ act->last_touch=time(NULL); if((ret==-1)||(ret==0)) -@@ -2606,10 +2728,26 @@ +@@ -2674,10 +2798,26 @@ /*******************************************************/ int manage_srch_port(int srch_sck, int sck) { diff --git a/net-p2p/dctc/files/patch-src:keyboard.c b/net-p2p/dctc/files/patch-src:keyboard.c new file mode 100644 index 000000000000..c4deac75ca14 --- /dev/null +++ b/net-p2p/dctc/files/patch-src:keyboard.c @@ -0,0 +1,18 @@ +--- src/keyboard.c.orig Sat Nov 24 13:29:15 2001 ++++ src/keyboard.c Sat Nov 24 13:43:51 2001 +@@ -31,6 +31,7 @@ + #include <netdb.h> + #include <glib.h> + ++#if !(defined(BSD) && (BSD >= 199103)) + #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) + /* union semun is defined by including <sys/sem.h> */ + #else +@@ -42,6 +43,7 @@ + struct seminfo *__buf; /* buffer for IPC_INFO */ + }; + #endif ++#endif + + #include "dc_com.h" + #include "display.h" diff --git a/net-p2p/dctc/files/patch-src:main.c b/net-p2p/dctc/files/patch-src:main.c new file mode 100644 index 000000000000..c1d90f1f876a --- /dev/null +++ b/net-p2p/dctc/files/patch-src:main.c @@ -0,0 +1,27 @@ +--- src/main.c.orig Sat Nov 24 13:22:57 2001 ++++ src/main.c Sat Nov 24 13:25:24 2001 +@@ -30,12 +30,23 @@ + #include <sys/param.h> + #include <sys/utsname.h> + #include <sys/un.h> +-#include <linux/sem.h> /* for the value of SEMVMX */ + #include <errno.h> + #include <getopt.h> + #include <string.h> + #include <glib.h> + #include <pthread.h> ++ ++#if (defined(__unix__) || defined(unix)) && !defined(USG) ++#include <sys/param.h> ++#endif ++ ++#if (defined(BSD) && (BSD >= 199103)) ++# include <sys/ipc.h> ++# include <sys/sem.h> ++#else ++/* For linux */ ++# include <linux/sem.h> /* for the value of SEMVMX */ ++#endif + + #include "var.h" + #include "display.h" diff --git a/net-p2p/dctc/files/patch-src:sema.c b/net-p2p/dctc/files/patch-src:sema.c new file mode 100644 index 000000000000..681575d0f4ed --- /dev/null +++ b/net-p2p/dctc/files/patch-src:sema.c @@ -0,0 +1,31 @@ +--- src/sema.c.orig Sat Nov 24 13:48:16 2001 ++++ src/sema.c Sat Nov 24 14:53:39 2001 +@@ -31,6 +31,11 @@ + + #include "sema.h" + ++#if (defined(__unix__) || defined(unix)) && !defined(USG) ++#include <sys/param.h> ++#endif ++ ++#if !(defined(BSD) && (BSD >= 199103)) + #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) + /* union semun is defined by including <sys/sem.h> */ + #else +@@ -42,6 +47,7 @@ + struct seminfo *__buf; /* buffer for IPC_INFO */ + }; + #endif ++#endif + + #ifndef IPC_ALLOC + #define IPC_ALLOC 0 +@@ -201,7 +207,7 @@ + + pthread_attr_init (&thread_attr); + pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); +- if(pthread_create(&thread_id,&thread_attr, (void*)sema_master,(void*)semid)!=0) ++ if(pthread_create(&thread_id,&thread_attr, sema_master,(void*)semid)!=0) + { + /* if the creation of the clock thread fails, release the master sema */ + /* else nobody will try to create a new clock and all xfers will hang */ |