[PATCH] Fix minor breakage on Cygwin: auth-passwd.c and session.c

Corinna Vinschen vinschen at redhat.com
Mon Aug 11 20:11:28 EST 2003


On Tue, Aug 05, 2003 at 08:23:00PM +1000, Darren Tucker wrote:
> Ben Lindstrom wrote:
> > However, yes.  The code should go to bsd-cygwin_util.h unless there is
> > some overriding reason not to... Corinna is there a reason we shouldn't
> > make this change?
> 
> Here's the current proposed patch, which works for me.
> 
> No one has commented on the session_break_req() change... 

That's not the right way to do it, AFAICS.  Wouldn't it be better to
use the tcflow() system call as described in SUSv3 and which should be
available on all systems?

Index: session.c
===================================================================
RCS file: /cvs/openssh_cvs/session.c,v
retrieving revision 1.244
diff -p -u -r1.244 session.c
--- session.c	7 Aug 2003 06:28:16 -0000	1.244
+++ session.c	11 Aug 2003 10:07:39 -0000
@@ -1696,20 +1696,16 @@ session_break_req(Session *s)
 	break_length = packet_get_int();
 	packet_check_eom();
 
-#if defined(TIOCSBRK) && defined(TIOCCBRK)
 	if (s->ttyfd == -1)
 		return 0;
 	/* we will sleep from 500ms to 3000ms */
 	break_length = MIN(break_length, 3000);
 	break_length = MAX(break_length,  500);
-	ioctl(s->ttyfd, TIOCSBRK, NULL);
+	tcflow(s->ttyfd,TCOOFF);
 	/* should we care about EINTR? */
 	usleep(break_length * 1000);
-	ioctl(s->ttyfd, TIOCCBRK, NULL);
+	tcflow(s->ttyfd,TCOON);
 	return 1;
-#else
-	return 0;
-#endif
 }
 
 static int

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat.com




More information about the openssh-unix-dev mailing list