diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 15:49:30 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 15:49:30 +0000 |
commit | e14d51045326808a48d43d7e0b45860cd33e2b17 (patch) | |
tree | 90b47e500bf7b1ccffae92fc2105cea5b8b7b61f /libio/fputc.c | |
parent | c949e9c224c0fc890982cc42797ae868b04faa00 (diff) | |
parent | 963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff) |
Merge commit 'refs/top-bases/t/context_functions' into t/context_functions
Diffstat (limited to 'libio/fputc.c')
-rw-r--r-- | libio/fputc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libio/fputc.c b/libio/fputc.c index 261fa2d1b1..1e743eb74c 100644 --- a/libio/fputc.c +++ b/libio/fputc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993-2016 Free Software Foundation, Inc. +/* Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,17 +28,19 @@ #include "stdio.h" int -fputc (int c, _IO_FILE *fp) +fputc (int c, FILE *fp) { int result; CHECK_FILE (fp, EOF); + if (!_IO_need_lock (fp)) + return _IO_putc_unlocked (c, fp); _IO_acquire_lock (fp); result = _IO_putc_unlocked (c, fp); _IO_release_lock (fp); return result; } -#if defined weak_alias && !defined _IO_MTSAFE_IO +#ifndef _IO_MTSAFE_IO #undef fputc_unlocked weak_alias (fputc, fputc_unlocked) #endif |