aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-subr.c
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-06-04 18:07:38 +0100
committerNick Alcock <nick.alcock@oracle.com>2020-07-22 18:02:18 +0100
commite148b73013109517c4d179aa9ae5a50b6d1dd5b5 (patch)
treef35a67a172a16852efc56d6d1fdbb586cf307dcc /libctf/ctf-subr.c
parent1fa7a0c24e78e7f7995a3fa608c9f97a6ccbe1b6 (diff)
downloadgdb-e148b73013109517c4d179aa9ae5a50b6d1dd5b5.zip
gdb-e148b73013109517c4d179aa9ae5a50b6d1dd5b5.tar.gz
gdb-e148b73013109517c4d179aa9ae5a50b6d1dd5b5.tar.bz2
libctf: drop error-prone ctf_strerror
This utility function is almost useless (all it does is casts the result of a strerror) but has a seriously confusing name. Over and over again I have accidentally called it instead of ctf_errmsg, and hidden a time-bomb for myself in a hard-to-test error-handling path: since ctf_strerror is just a strerror wrapper, it cannot handle CTF errnos, unlike ctf_errmsg. It's astonishingly lucky that none of these errors have crept into any commits to date. Fuse it into ctf_errmsg and drop it. libctf/ * ctf-impl.h (ctf_strerror): Delete. * ctf-subr.c (ctf_strerror): Likewise. * ctf-error.c (ctf_errmsg): Stop using ctf_strerror: just use strerror directly.
Diffstat (limited to 'libctf/ctf-subr.c')
-rw-r--r--libctf/ctf-subr.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/libctf/ctf-subr.c b/libctf/ctf-subr.c
index 0b49ae9..455f18d 100644
--- a/libctf/ctf-subr.c
+++ b/libctf/ctf-subr.c
@@ -122,12 +122,6 @@ ctf_pread (int fd, void *buf, ssize_t count, off_t offset)
return acc;
}
-const char *
-ctf_strerror (int err)
-{
- return (const char *) (strerror (err));
-}
-
/* Set the CTF library client version to the specified version. If version is
zero, we just return the default library version number. */
int