diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-06-19 20:55:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-06-20 12:25:51 -0700 |
commit | f61bf72e61f012e173acc15dfda71a3e5371bde1 (patch) | |
tree | f1830c5a993d594e200423243c5dffcbcd88aad7 /sysif.h | |
parent | 29a25713116323adcac696a090420ed3c1e73e5f (diff) | |
download | txr-f61bf72e61f012e173acc15dfda71a3e5371bde1.tar.gz txr-f61bf72e61f012e173acc15dfda71a3e5371bde1.tar.bz2 txr-f61bf72e61f012e173acc15dfda71a3e5371bde1.zip |
Replace all strerror calls with wrapper.
All string_utf8(strerror(x)) calls are replaced with
errno_to_str(x).
* sysif.c (errno_to_str): New function.
(strerror_wrap): Now implemented via call to errno_to_str.
(mkdir_wrap, ensure_dir, chdir_wrap, getcwd_wrap, rmdir_wrap,
mknod_wrap, mkfifo_wrap, chmod_wrap, do_chown, symlink_wrap,
link_wrap, readlink_wrap, close_wrap, exec_wrap, stat_impl,
do_utimes, pipe_wrap, poll_wrap, getgroups_wrap, setuid_wrap,
seteuid_wrap, setgid_wrap, setegid_wrap, setgroups_wrap,
getresuid_wrap, getresgid_wrap, setresuid_wrap,
setresgid_wrap, crypt_wrap, uname_wrap): Use errno_to_str.
* sysif.h (errno_to_str): Declared.
* ftw.c (ftw_wrap): Use errno_to_str.
* socket.c (dgram_get_byte_callback, dgram_flush, sock_bind,
open_sockfd, sock_connect, sock_listen, sock_accept,
sock_shutdown, sock_timeout, socketpair_wrap): Likewise.
* stream.c (errno_to_string): Likewise, and don't handle
zero case any more; pass down to errno_to_str.
(stdio_close, pipe_close open_directory, open_file,
open_fileno, open_tail, fds_subst, open_command,
open_subprocess, run, remove_path, rename_path): Use
errno_to_str.
* termios.c (tcgetattr_wrap, tcsetattr_wrap, tcsetattr_wrap,
tcsendbreak_wrap, tcdrain_wrap, tcflush_wrap, tcflow_wrap):
Likewise.
diff --git a/termios.c b/termios.c
Diffstat (limited to 'sysif.h')
-rw-r--r-- | sysif.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -37,6 +37,7 @@ extern val path_s; val errno_to_file_error(int err); val getenv_wrap(val name); +val errno_to_str(int err); val at_exit_call(val func); val at_exit_do_not_call(val func); val usleep_wrap(val usec); |