diff options
Diffstat (limited to 'lib/isc/unix/stdio.c')
| -rw-r--r-- | lib/isc/unix/stdio.c | 17 | 
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/isc/unix/stdio.c b/lib/isc/unix/stdio.c index 90ee6dbfb6fd..360c8c644afc 100644 --- a/lib/isc/unix/stdio.c +++ b/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.332.2 2011-03-12 04:57:32 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));  | 
