From 9bd77dca9257817f592b44a5b05329e8bdc6d0f1 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Wed, 3 Jul 2013 06:41:52 +0000 Subject: Use WAIT_* for the first argument to wait4(), and otherwise treat it (and the first argument to kill) as signed 32bit ints. ok millert@ otto@ --- usr.bin/kdump/kdump.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 76dcfeb256d..193c48d71ef 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kdump.c,v 1.81 2013/06/01 09:51:30 miod Exp $ */ +/* $OpenBSD: kdump.c,v 1.82 2013/07/03 06:41:51 guenther Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #define _KERNEL @@ -162,6 +163,8 @@ static void setemul(const char *); static void usage(void); static void atfd(int); static void polltimeout(int); +static void pgid(int); +static void wait4pid(int); int main(int argc, char *argv[]) @@ -627,7 +630,7 @@ ktrsyscall(struct ktr_syscall *ktr) break; } case SYS_kill: - pn(NULL); + pn(pgid); pn(signame); break; case SYS_lseek: @@ -792,7 +795,7 @@ ktrsyscall(struct ktr_syscall *ktr) plln(); break; case SYS_wait4: - pn(NULL); + pn(wait4pid); pn(NULL); pn(wait4optname); break; @@ -1655,3 +1658,20 @@ polltimeout(int timeout) else (void)printf("%#x", timeout); } + +static void +pgid(int pid) +{ + (void)printf("%d", pid); +} + +static void +wait4pid(int pid) +{ + if (pid == WAIT_ANY) + (void)printf("WAIT_ANY"); + else if (pid == WAIT_MYPGRP) + (void)printf("WAIT_MYPGRP"); + else + pgid(pid); +} -- cgit v1.2.3