diff options
Diffstat (limited to 'src/history/history.c')
-rw-r--r-- | src/history/history.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/history/history.c b/src/history/history.c index ad917e65ba08d..b94fbb7b3fdfc 100644 --- a/src/history/history.c +++ b/src/history/history.c @@ -1,9 +1,9 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * SPDX-License-Identifier: BSD-2-Clause * - * All rights reserved. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -47,8 +47,6 @@ * Copyright (c) 2010-2016, Salvatore Sanfilippo <antirez at gmail dot com> * Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com> * - * All rights reserved. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: @@ -482,15 +480,17 @@ static void bc_history_enableRaw(BcHistory *h) { static void bc_history_disableRaw(BcHistory *h) { + sig_atomic_t lock; + // Don't even check the return value as it's too late. if (!h->rawMode) return; - BC_SIG_LOCK; + BC_SIG_TRYLOCK(lock); if (BC_ERR(tcsetattr(STDIN_FILENO, TCSAFLUSH, &h->orig_termios) != -1)) h->rawMode = false; - BC_SIG_UNLOCK; + BC_SIG_TRYUNLOCK(lock); } /** |