aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcomex2015-01-25 01:52:49 -0500
committercomex2015-01-25 01:52:49 -0500
commitd8e5824e8bdf89e95c618c554b34e8789e58bd3c (patch)
tree182049e6828c360e6aaa26e859a0da22ac5bd047 /lib
parentAdd an explanatory (and legally obligatory) notice to substrate.h. (diff)
downloadsubstitute-d8e5824e8bdf89e95c618c554b34e8789e58bd3c.tar.gz
fix strerror
Diffstat (limited to '')
-rw-r--r--lib/hook-functions.c2
-rw-r--r--lib/strerror.c6
-rw-r--r--lib/substitute.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c
index cc8bd3e..9d34400 100644
--- a/lib/hook-functions.c
+++ b/lib/hook-functions.c
@@ -245,7 +245,7 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks,
if ((ret = apply_pc_patch_callback(stop_token, pc_callback, &info)))
goto end;
if (info.encountered_bad_pc) {
- ret = SUBSTITURE_ERR_UNEXPECTED_PC_ON_OTHER_THREAD;
+ ret = SUBSTITUTE_ERR_UNEXPECTED_PC_ON_OTHER_THREAD;
goto end;
}
}
diff --git a/lib/strerror.c b/lib/strerror.c
index ac72214..3cdecae 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -5,14 +5,20 @@ EXPORT
const char *substitute_strerror(int err) {
#define CASE(code) case code: return #code
switch (err) {
+ /* substitute.h */
CASE(SUBSTITUTE_OK);
CASE(SUBSTITUTE_ERR_FUNC_TOO_SHORT);
CASE(SUBSTITUTE_ERR_FUNC_BAD_INSN_AT_START);
CASE(SUBSTITUTE_ERR_FUNC_JUMPS_TO_START);
CASE(SUBSTITUTE_ERR_OOM);
CASE(SUBSTITUTE_ERR_VM);
+ CASE(SUBSTITUTE_ERR_NOT_ON_MAIN_THREAD);
+ CASE(SUBSTITUTE_ERR_UNEXPECTED_PC_ON_OTHER_THREAD);
+ CASE(SUBSTITUTE_ERR_OUT_OF_RANGE);
CASE(SUBSTITUTE_ERR_UNKNOWN_RELOCATION_TYPE);
CASE(SUBSTITUTE_ERR_NO_SUCH_SELECTOR);
+ CASE(SUBSTITUTE_ERR_ADJUSTING_THREADS);
+ /* substitute-internal.h */
CASE(SUBSTITUTE_ERR_TASK_FOR_PID);
CASE(SUBSTITUTE_ERR_MISC);
default:
diff --git a/lib/substitute.h b/lib/substitute.h
index 2aa7ed8..bdd63e0 100644
--- a/lib/substitute.h
+++ b/lib/substitute.h
@@ -57,7 +57,7 @@ enum {
* instruction boundary
* The hooks were otherwise completed, but the thread in question will
* probably crash now that its code has changed under it. */
- SUBSTITURE_ERR_UNEXPECTED_PC_ON_OTHER_THREAD,
+ SUBSTITUTE_ERR_UNEXPECTED_PC_ON_OTHER_THREAD,
/* substitute_hook_functions: destination was out of range, and mmap
* wouldn't give us a trampoline in range */