Date: Wed, 30 Jul 1997 13:20:37 -0400 From: Brian McGovern <bmcgover@cisco.com> To: questions@freebsd.org Cc: ivan@cyclades.com Subject: ENOENT on read? (Problem with tip) Message-ID: <199707301720.NAA00395@bmcgover-pc.cisco.com>
next in thread | raw e-mail | index | archive | help
I'm having problems with tip connecting to a serial port. I've tracked the point of failure to the line just after the printf("Point 1\n"); below. I've now reached the point where "I just don't get it" (tm). I've found, from hunt.c, that its trying to open /dev/cuacA00, which is the correct device, so the "No such file or directory" description in /usr/include/sys/errno.h makes little sense. Also, the descriptor FD is usually either 3 or 4, so its not that its a bad descriptor from the open, either. Lastly, I don't see any calls to fnctl to set the socket non-blocking (or in the open for that matter), so the read should block until there is data. Anyhow, any sugguestions are welcome. -Brian for (omask = 0;; sigsetmask(omask)) { cnt = read(FD, buf, BUFSIZ); if (cnt <= 0) { /* lost carrier */ if (cnt < 0 && errno == EIO) { sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } else if (cnt == 0 && errno == ENOENT) { printf("Point 1\n"); if (getppid() != 1) kill(getppid(),SIGUSR1); sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } else if (cnt < 0) { printf("Point 2\n"); if (getppid() != 1) kill(getppid(),SIGUSR1); sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } continue; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707301720.NAA00395>