Commits

Anonymous committed 99f5bc2

updated patches that avoid the race condition

  • Participants
  • Parent commits a0b7245

Comments (0)

Files changed (2)

File ii-1.4-autojoin.diff

-diff -r 1584832e6f96 ii.c
---- a/ii.c	Mon Jun 01 13:39:01 2009 +0200
-+++ b/ii.c	Fri Jun 25 21:19:39 2010 -0700
-@@ -211,6 +211,7 @@
+diff -r d93eaacde742 ii.c
+--- a/ii.c	Fri Jun 25 10:55:05 2010 +0200
++++ b/ii.c	Mon Jul 12 15:30:45 2010 -0700
+@@ -210,6 +210,7 @@
+ 	if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
  	if(strstr(buf, server)) channel="";
  	create_filepath(outfile, sizeof(outfile), channel, "out");
++	if(channel && channel[0]) add_channel(channel);
  	if(!(out = fopen(outfile, "a"))) return;
-+	if(channel && channel[0]) add_channel(channel);
  
  	strftime(buft, sizeof(buft), "%F %R", localtime(&t));
- 	fprintf(out, "%s %s\n", buft, buf);

File ii-1.4-joinuser.diff

 diff -r d93eaacde742 ii.c
 --- a/ii.c	Fri Jun 25 10:55:05 2010 +0200
-+++ b/ii.c	Thu Jul 08 00:55:27 2010 -0700
++++ b/ii.c	Mon Jul 12 15:37:39 2010 -0700
 @@ -105,6 +105,7 @@
  	return open(infile, O_RDONLY | O_NONBLOCK, 0);
  }
 +
 +	if(name[0] && !((name[0]=='#')||(name[0]=='&')||(name[0]=='+')||(name[0]=='!'))) {
 +		char msg[128];
-+		snprintf(msg, sizeof(msg), "-!- %s has joined %s", nick, name);
++		snprintf(msg, PIPE_BUF, "-!- %s has joined %s", nick, name);
 +		print_out(name, msg);
 +	}
  }
  
  static void rm_channel(Channel *c) {
-@@ -211,6 +218,7 @@
+@@ -210,6 +217,7 @@
+ 	if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
  	if(strstr(buf, server)) channel="";
  	create_filepath(outfile, sizeof(outfile), channel, "out");
++	if(channel && channel[0]) add_channel(channel);
  	if(!(out = fopen(outfile, "a"))) return;
-+	if(channel && channel[0]) add_channel(channel);
  
  	strftime(buft, sizeof(buft), "%F %R", localtime(&t));
- 	fprintf(out, "%s %s\n", buft, buf);
 @@ -237,17 +245,14 @@
  		case 'j':
  			p = strchr(&buf[3], ' ');