/* Ensure no single-step breakpoint is pending. Returns non-zero value if child was being single-stepped.  */
int ptrace_cancel_bpt(struct task_struct *child)
/* Ensure no single-step breakpoint is pending. Returns non-zero value if child was being single-stepped.  */
int ptrace_cancel_bpt(struct task_struct *child)
{
	int i, nsaved = task_thread_info(child)->bpt_nsaved;
	task_thread_info(child)->bpt_nsaved = 0;
	if (nsaved > 2) {
		printk("ptrace_cancel_bpt: bogus nsaved: %d!\n", nsaved);
		nsaved = 2;
	}
	for (i = 0; i < nsaved; ++i) {
		write_int(child, task_thread_info(child)->bpt_addr[i],
			  task_thread_info(child)->bpt_insn[i]);
	}
	return (nsaved != 0);
}