From b2aea040ec349bf51b5e1ea1ded72918dd598021 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 3 Jan 2019 10:26:37 +0100 Subject: [PATCH] mescc: Mes C Library: Support GNU Awk: Do not flush std files. * lib/stdio/fflush.c (fflush): Do not flush std files. --- include/ctype.h | 2 +- lib/libc+gnu.c | 2 +- lib/stdio/fflush.c | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/ctype.h b/include/ctype.h index f8acf16a..8066561a 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * diff --git a/lib/libc+gnu.c b/lib/libc+gnu.c index 3e8d59f8..873228c4 100644 --- a/lib/libc+gnu.c +++ b/lib/libc+gnu.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * diff --git a/lib/stdio/fflush.c b/lib/stdio/fflush.c index c92587eb..b82fdd34 100644 --- a/lib/stdio/fflush.c +++ b/lib/stdio/fflush.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -23,5 +23,8 @@ int fflush (FILE *stream) { - fsync ((int)stream); + int filedes = (int)stream; + if (filedes < 3) + return 0; + return fsync (filedes); }