summaryrefslogtreecommitdiffstats
path: root/ftw.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-19 20:55:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-20 12:25:51 -0700
commitf61bf72e61f012e173acc15dfda71a3e5371bde1 (patch)
treef1830c5a993d594e200423243c5dffcbcd88aad7 /ftw.c
parent29a25713116323adcac696a090420ed3c1e73e5f (diff)
downloadtxr-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 'ftw.c')
-rw-r--r--ftw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ftw.c b/ftw.c
index 9e066754..99178961 100644
--- a/ftw.c
+++ b/ftw.c
@@ -126,7 +126,7 @@ val ftw_wrap(val dirpath, val fn, val flags_in, val nopenfd_in)
{
int eno = errno;
uw_throwf(errno_to_file_error(eno), lit("ftw ~a: ~d/~s"),
- dirpath, num(eno), string_utf8(strerror(eno)), nao);
+ dirpath, num(eno), errno_to_str(eno), nao);
}
default:
return num(res);