From b22902b65d27ef1860328b2dc3be2a5e28c4be44 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 7 Nov 2004 07:04:31 +0000 Subject: [PATCH] Use non-blocking I/O when opening the tty. Otherwise we can get stuck... --- libexec/utmp_update/utmp_update.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/utmp_update/utmp_update.c b/libexec/utmp_update/utmp_update.c index 89b6c2b36335..c37346ef615d 100644 --- a/libexec/utmp_update/utmp_update.c +++ b/libexec/utmp_update/utmp_update.c @@ -1,4 +1,4 @@ -/* $NetBSD: utmp_update.c,v 1.6 2003/02/26 18:16:50 christos Exp $ */ +/* $NetBSD: utmp_update.c,v 1.7 2004/11/07 07:04:31 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__RCSID("$NetBSD: utmp_update.c,v 1.6 2003/02/26 18:16:50 christos Exp $"); +__RCSID("$NetBSD: utmp_update.c,v 1.7 2004/11/07 07:04:31 christos Exp $"); #include #include @@ -108,7 +108,7 @@ main(int argc, char *argv[]) } (void)snprintf(tty, sizeof(tty), "%s%s", _PATH_DEV, utx->ut_line); - fd = open(tty, O_RDONLY, 0); + fd = open(tty, O_RDONLY|O_NONBLOCK, 0); if (fd != -1) { if (fstat(fd, &st) == -1) err(1, "Cannot stat `%s'", tty);