diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-04-16 06:04:33 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-04-16 06:04:33 -0700 |
commit | 6b7374d7179d9be8ef2fb39928917cc3fd37453a (patch) | |
tree | fa4abaf583aa589750b317bbe88930a890205115 /checkman.txr | |
parent | 9e9513462ff0f82854dbc9d3f8bd42cd2ed8766e (diff) | |
download | txr-6b7374d7179d9be8ef2fb39928917cc3fd37453a.tar.gz txr-6b7374d7179d9be8ef2fb39928917cc3fd37453a.tar.bz2 txr-6b7374d7179d9be8ef2fb39928917cc3fd37453a.zip |
open-file: allow async signals.
With this patch, if open-file blocks (for instance on a FIFO
or device), it is interruptible. In the listener, the
operation can be aborted with Ctrl-C now.
* stream.c (w_fopen_mode): If we HAVE_FCNTL, then handle all
file opening via open + fdopen, rather than fopen. On
platforms where we use fopen, interruptibility won't work.
The fopen function cannot be abandoned via an exception thrown
from a signal handler because it performs memory allocation.
Because we need a temporary UTF-8 string to do the open,
which might be abandoned by a signal, let's move the string to
the stack via alloca, and free the original, so we don't have
to set up unwinding to free it.
Diffstat (limited to 'checkman.txr')
0 files changed, 0 insertions, 0 deletions