diff options
author | Doug Barton <dougb@FreeBSD.org> | 2012-04-05 04:29:35 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2012-04-05 04:29:35 +0000 |
commit | d0f6280db790de2ad69bd01a1275e350cbd2840d (patch) | |
tree | cf3176c0801c94a4f298353cc450f10cf1aae9c0 /contrib/bind9/lib/isc/unix/stdio.c | |
parent | 8931e524bfb5c6a10894f704e3eaa05ee5d9fa77 (diff) | |
parent | 42d3eba523963ab015ac451eeea0788b11631c94 (diff) |
Update to version 9.8.2, the latest from ISC, which contains numerous bug fixes.
Notes
Notes:
svn path=/head/; revision=233914
Diffstat (limited to 'contrib/bind9/lib/isc/unix/stdio.c')
-rw-r--r-- | contrib/bind9/lib/isc/unix/stdio.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/bind9/lib/isc/unix/stdio.c b/contrib/bind9/lib/isc/unix/stdio.c index 9221d2a0ea7d..360c8c644afc 100644 --- a/contrib/bind9/lib/isc/unix/stdio.c +++ b/contrib/bind9/lib/isc/unix/stdio.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: stdio.c,v 1.8.814.2 2011-03-05 23:52:09 tbox Exp $ */ +/* $Id$ */ #include <config.h> @@ -105,12 +105,23 @@ isc_stdio_flush(FILE *f) { return (isc__errno2result(errno)); } +/* + * OpenBSD has deprecated ENOTSUP in favor of EOPNOTSUPP. + */ +#if defined(EOPNOTSUPP) && !defined(ENOTSUP) +#define ENOTSUP EOPNOTSUPP +#endif + isc_result_t isc_stdio_sync(FILE *f) { int r; r = fsync(fileno(f)); - if (r == 0) + /* + * fsync is not supported on sockets and pipes which + * result in EINVAL / ENOTSUP. + */ + if (r == 0 || errno == EINVAL || errno == ENOTSUP) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); |