[misc.c]
     error-> debug, because O_NONBLOCK for /dev/null causes too many different
     errnos; ok stevesk@, deraadt@
     unused include
This commit is contained in:
Ben Lindstrom 2002-03-05 01:48:09 +00:00
parent d96c8b3b56
commit 84fcb312ff
2 changed files with 11 additions and 9 deletions

View File

@ -40,6 +40,10 @@
thanks to wilfried@ thanks to wilfried@
- markus@cvs.openbsd.org 2002/03/04 12:43:06 - markus@cvs.openbsd.org 2002/03/04 12:43:06
[auth-passwd.c auth-rh-rsa.c auth-rhosts.c] [auth-passwd.c auth-rh-rsa.c auth-rhosts.c]
- markus@cvs.openbsd.org 2002/03/04 13:10:46
[misc.c]
error-> debug, because O_NONBLOCK for /dev/null causes too many different
errnos; ok stevesk@, deraadt@
unused include unused include
20020226 20020226
@ -7772,4 +7776,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1902 2002/03/05 01:45:56 mouring Exp $ $Id: ChangeLog,v 1.1903 2002/03/05 01:48:09 mouring Exp $

14
misc.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: misc.c,v 1.17 2002/02/26 20:03:51 stevesk Exp $ */ /* $OpenBSD: misc.c,v 1.18 2002/03/04 13:10:46 markus Exp $ */
/* /*
* Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2000 Markus Friedl. All rights reserved.
@ -25,7 +25,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: misc.c,v 1.17 2002/02/26 20:03:51 stevesk Exp $"); RCSID("$OpenBSD: misc.c,v 1.18 2002/03/04 13:10:46 markus Exp $");
#include "misc.h" #include "misc.h"
#include "log.h" #include "log.h"
@ -65,9 +65,8 @@ set_nonblock(int fd)
debug("fd %d setting O_NONBLOCK", fd); debug("fd %d setting O_NONBLOCK", fd);
val |= O_NONBLOCK; val |= O_NONBLOCK;
if (fcntl(fd, F_SETFL, val) == -1) if (fcntl(fd, F_SETFL, val) == -1)
if (errno != ENODEV) debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s",
error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno));
fd, strerror(errno));
} }
void void
@ -87,9 +86,8 @@ unset_nonblock(int fd)
debug("fd %d clearing O_NONBLOCK", fd); debug("fd %d clearing O_NONBLOCK", fd);
val &= ~O_NONBLOCK; val &= ~O_NONBLOCK;
if (fcntl(fd, F_SETFL, val) == -1) if (fcntl(fd, F_SETFL, val) == -1)
if (errno != ENODEV) debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s",
error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno));
fd, strerror(errno));
} }
/* disable nagle on socket */ /* disable nagle on socket */