diff options
| author | Mark Wielaard <[email protected]> | 2019-01-31 23:18:25 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2019-01-31 23:18:25 +0100 |
| commit | fe7d3f3635e66fe8ec1fde91f886857b0dea7d22 (patch) | |
| tree | 1bb348012cb33abad91781d6cd02dcbda75acb56 /tests/backtrace.c | |
| parent | cfaf954701fdb74f8d1da2a8f8f4ddb666e39b34 (diff) | |
tests: Remove assert (errno == 0) from tests.
When a function fails it might set errno. But it isn't a guarantee
that if a function succeeds that it sets errno to zero.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests/backtrace.c')
| -rw-r--r-- | tests/backtrace.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/tests/backtrace.c b/tests/backtrace.c index 24ab68dd..05e8ef82 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -281,16 +281,13 @@ prepare_thread (pid_t pid2 __attribute__ ((unused)), struct user_regs_struct user_regs; errno = 0; l = ptrace (PTRACE_GETREGS, pid2, 0, (intptr_t) &user_regs); - assert (errno == 0); assert (l == 0); user_regs.rip = (intptr_t) jmp; l = ptrace (PTRACE_SETREGS, pid2, 0, (intptr_t) &user_regs); - assert (errno == 0); assert (l == 0); l = ptrace (PTRACE_CONT, pid2, NULL, (void *) (intptr_t) SIGUSR2); int status; pid_t got = waitpid (pid2, &status, __WALL); - assert (errno == 0); assert (got == pid2); assert (WIFSTOPPED (status)); assert (WSTOPSIG (status) == SIGUSR1); @@ -358,7 +355,6 @@ exec_dump (const char *exec) errno = 0; int status; pid_t got = waitpid (pid, &status, 0); - assert (errno == 0); assert (got == pid); assert (WIFSTOPPED (status)); // Main thread will signal SIGUSR2. Other thread will signal SIGUSR1. @@ -368,7 +364,6 @@ exec_dump (const char *exec) __WCLONE, probably despite pthread_create already had to be called the new task is not yet alive enough for waitpid. */ pid_t pid2 = waitpid (-1, &status, __WALL); - assert (errno == 0); assert (pid2 > 0); assert (pid2 != pid); assert (WIFSTOPPED (status)); |
