summaryrefslogtreecommitdiffstats
path: root/tests/backtrace.c
diff options
context:
space:
mode:
authorMax Filippov <[email protected]>2015-05-04 20:17:52 +0300
committerMark Wielaard <[email protected]>2015-05-05 10:36:53 +0200
commitc801acf1cb6ee95044d11ad8ed8ebf879db0444c (patch)
tree8006f7d9393f18025aa67c8df38cb99866a03005 /tests/backtrace.c
parent8c4aa0ef998191ed828a37190dc179b91649938a (diff)
Replace assert_perror with assert
assert_perror is a GNU extension, it's not provided by uClibc and it's only used in tests. Replace it with assert. Signed-off-by: Max Filippov <[email protected]>
Diffstat (limited to 'tests/backtrace.c')
-rw-r--r--tests/backtrace.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/backtrace.c b/tests/backtrace.c
index 8b19b947..abd56ab6 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -263,16 +263,16 @@ 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_perror (errno);
+ assert (errno == 0);
assert (l == 0);
user_regs.rip = (intptr_t) jmp;
l = ptrace (PTRACE_SETREGS, pid2, 0, (intptr_t) &user_regs);
- assert_perror (errno);
+ 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_perror (errno);
+ assert (errno == 0);
assert (got == pid2);
assert (WIFSTOPPED (status));
assert (WSTOPSIG (status) == SIGUSR1);
@@ -340,7 +340,7 @@ exec_dump (const char *exec)
errno = 0;
int status;
pid_t got = waitpid (pid, &status, 0);
- assert_perror (errno);
+ assert (errno == 0);
assert (got == pid);
assert (WIFSTOPPED (status));
// Main thread will signal SIGUSR2. Other thread will signal SIGUSR1.
@@ -350,7 +350,7 @@ 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_perror (errno);
+ assert (errno == 0);
assert (pid2 > 0);
assert (pid2 != pid);
assert (WIFSTOPPED (status));