diff options
Diffstat (limited to 'lib/libproc/proc_util.c')
-rw-r--r-- | lib/libproc/proc_util.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libproc/proc_util.c b/lib/libproc/proc_util.c index 4d9aa20..8a461c3 100644 --- a/lib/libproc/proc_util.c +++ b/lib/libproc/proc_util.c @@ -2,7 +2,7 @@ * Copyright (c) 2010 The FreeBSD Foundation * Copyright (c) 2008 John Birrell (jb@freebsd.org) * All rights reserved. - * + * * Portions of this software were developed by Rui Paulo under sponsorship * from the FreeBSD Foundation. * @@ -26,18 +26,21 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/types.h> #include <sys/ptrace.h> #include <sys/wait.h> + #include <err.h> #include <errno.h> #include <signal.h> #include <string.h> #include <unistd.h> + #include "_libproc.h" int @@ -58,13 +61,15 @@ proc_clearflags(struct proc_handle *phdl, int mask) int proc_continue(struct proc_handle *phdl) { - int pending = 0; + int pending; if (phdl == NULL) return (-1); if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) pending = WSTOPSIG(phdl->wstat); + else + pending = 0; if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0) return (-1); @@ -104,7 +109,7 @@ proc_getflags(struct proc_handle *phdl) if (phdl == NULL) return (-1); - return(phdl->flags); + return (phdl->flags); } int |