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

Corinna Vinschen vinschen at redhat.com
Tue Aug 12 23:17:57 EST 2003


On Tue, Aug 12, 2003 at 10:26:39PM +1000, Darren Tucker wrote:
> > Either way, it would be helpful to substitute the ioctl() by a more
> > portable call instead of just ignoring it entirely if the ioctl()
> > code isn't available.
> 
> The catch is the tcsendbreak can't (generally? portably?) specify the
> duration of the break, you get a hard-coded delay.

That's right but it doesn't matter, I guess.  According to SUSv3,
tcsendbreak(fd, 0) sends a break for "at least 0.25 seconds, and not
more than 0.5 seconds".  Since the sleep period is between 0.5 and
3 secs anyway, the function could just reduce the maximum sleep value
to 2.5 secs in which case the total sleep time is somewhere between
0.5 and 3 secs, dependent of the incoming break_length and whether this
implementation of tcsendbreak itself blocks or not:

        /* we will sleep from 500ms to 2500ms */
        break_length = MIN(break_length, 2500);
        break_length = MAX(break_length,  500);
        tcsendbreak(s->ttyfd, 0);
        /* should we care about EINTR? */
        usleep(break_length * 1000);
        return 1;

Corinna

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




More information about the openssh-unix-dev mailing list