From 4fc0806163ed2ce5e19eba59a8b7b77a1488ecf7 Mon Sep 17 00:00:00 2001 From: tron Date: Tue, 3 Sep 2002 06:17:26 +0000 Subject: [PATCH] Ignore EINVAL returned from fsync(2) because it is the expected error code if we try to use it on a pipe. --- bin/dd/dd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 5175201341a9..4379e8c412cf 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -1,4 +1,4 @@ -/* $NetBSD: dd.c,v 1.27 2002/09/01 11:33:22 enami Exp $ */ +/* $NetBSD: dd.c,v 1.28 2002/09/03 06:17:26 tron Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: dd.c,v 1.27 2002/09/01 11:33:22 enami Exp $"); +__RCSID("$NetBSD: dd.c,v 1.28 2002/09/03 06:17:26 tron Exp $"); #endif #endif /* not lint */ @@ -360,7 +360,7 @@ dd_close(void) } if (out.dbcnt) dd_out(1); - if (out.fd == STDOUT_FILENO && fsync(out.fd) == -1) + if (out.fd == STDOUT_FILENO && fsync(out.fd) == -1 && errno != EINVAL) err(1, "fsync stdout"); if (close(out.fd) == -1) err(1, "close");