vgetty functions, but mgetty can't receive faxes ...

Gert Doering (gert@greenie.muc.de)
Thu, 19 Feb 1998 09:27:51 +0100


Hi,

Marc Eberhard wrote:
> > I am able to receive calls with vgetty (last beta version), but faxes aren't
> > received .... I have a USR Sportster Vi (V.34(+))
> >
> > Here's an excerpt of the log (I hope the relevant part):
> >
> > 02/11 10:22:27 yS1 mdm_read_byte: read returned 0: Success
> > 02/11 10:22:27 yS1 mdm_get_line: cannot read byte, return: Success -> ERROR
> 
> Can some expert please explain me this _system_ error message? 

I think it means "we ran into a timeout".

The fax/data part of mgetty is programmed to run with VTIME=0, and I have
the nagging suspicion that vgetty still sets the VTIME value to >0 and
leaves it there... --> which would mean that mgetty's read() function
times out and returns "0", which is not what the code expects.

As I do the timeout handling with alarm(), I expect a return value of "-1"
and "errno=EINTR" for timeouts, not "0" and "errno=0" - so this message
is written.

It's the following code part from modem.c:

  frb_len = read( fd, frb_buf, sizeof( frb_buf ) );
  if ( frb_len <= 0 )
  {
  if ( frb_len == 0 ) errno = 0; /* undefined otherwise */
  lprintf( L_ERROR, "mdm_read_byte: read returned %d", frb_len
);
  return frb_len;
	}

You see, returning "0" is considered an error (as this is not something
that can happen in normal circumstances).

The *only* way I can explain this is if VTIME is set >0, which I remember
vgetty did "some time back in the past". I didn't check whether that's
still true (but that would explain things).

> I see
> the same problems with vgetty and in that case read returns a value
> <0, but errno is set to a value, that is reported as Success. I don't
> understand this. I thought, that a result of read with value <0
> means an error and errno is set apropriate? Am I missing something?

A return value <0 should definitely set errno to "something", yes.

On which operating system (Linux), under which circumstances do you 
observe this? Can it be reproduced? (Should *not* be a timeout, because
that should return "0").

gert
-- 
USENET is *not* the non-clickable part of WWW!
           //www.muc.de/~gert/
Gert Doering - Munich, Germany      gert@greenie.muc.de
fax: +49-89-35655025    gert.doering@physik.tu-muenchen.de
.