From cnh@foo.ems.mindspring.net Thu Apr 29 11:35:25 1999
Return-Path: <cnh@foo.ems.mindspring.net>
Received: from foo.ems.mindspring.net (foo.ems.mindspring.net [209.86.81.150])
	by hub.freebsd.org (Postfix) with ESMTP id C2E1915141
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Apr 1999 11:35:20 -0700 (PDT)
	(envelope-from cnh@foo.ems.mindspring.net)
Received: (from cnh@localhost)
	by foo.ems.mindspring.net (8.9.3/8.9.2) id OAA46997;
	Thu, 29 Apr 1999 14:35:43 -0400 (EDT)
	(envelope-from cnh)
Message-Id: <199904291835.OAA46997@foo.ems.mindspring.net>
Date: Thu, 29 Apr 1999 14:35:43 -0400 (EDT)
From: cnh@mindspring.com
Sender: cnh@foo.ems.mindspring.net
Reply-To: cnh@mindspring.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: patch for ircII so /window create works
X-Send-Pr-Version: 3.2

>Number:         11388
>Category:       ports
>Synopsis:       patch for ircII so /window create works
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    torstenb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 29 11:40:00 PDT 1999
>Closed-Date:    Wed Apr 19 14:33:55 PDT 2000
>Last-Modified:  Wed Apr 19 14:34:37 PDT 2000
>Originator:     Christopher N. Harrell
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
>Environment:

	Any 

>Description:

	The connect() call had an off-by-one, and an error was printed
	even if ttyname(0) succeeded.

>How-To-Repeat:

	cd /usr/ports/net/ircII ; make install ; irc
	/window create

>Fix:


--- wserv.c.orig	Fri Jan 17 14:53:54 1997
+++ wserv.c	Thu Apr 29 14:28:33 1999
@@ -87,7 +87,7 @@
 	strcpy(addr->sun_path, argv[1]);
 	s = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (0 > connect(s, (struct sockaddr *) addr, sizeof(addr->sun_family) +
-						strlen(addr->sun_path)))
+						strlen(addr->sun_path) + 1))
 		exit(0);
 
 	/*
@@ -95,10 +95,10 @@
 	 * can grab the size of the tty, and have it changed.
 	 */
 
-	tmp = ttyname(0);
+	if ((tmp = ttyname(0)) == NULL)
+		perror("ttyname(0)");
 	write(s, tmp, strlen(tmp));
 	write(s, "\n", 1);
-	perror(tmp);
 
 	term_init();
 

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->torstenb 
Responsible-Changed-By: steve 
Responsible-Changed-When: Fri Apr 30 18:59:41 PDT 1999 
Responsible-Changed-Why:  
Over to port's maintainer. 
State-Changed-From-To: open->feedback 
State-Changed-By: will 
State-Changed-When: Mon Apr 3 19:10:52 PDT 2000 
State-Changed-Why:  
I am unable to apply this patch against the current version 
of the ircII port. I tried to adapt to the newer wserv.c, but 
I was unsuccessful. Could you supply a newer patch that would 
work with ircII 4.4S? If I receive no reply in the next 
month, I will close this PR. Thanks. 
State-Changed-From-To: feedback->closed 
State-Changed-By: will 
State-Changed-When: Wed Apr 19 14:33:55 PDT 2000 
State-Changed-Why:  
Originator reported that this fix was applied to 4.4S. 
>Unformatted:
