#!/bin/sh

# Check success injection.

. "${srcdir=.}/scno_tampering.sh"

check_injection()
{
	local syscall rval

	syscall=chdir
	rval="$1"; shift

	run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \
		./qual_inject-retval "$rval" > "$EXP"
	match_diff "$LOG" "$EXP"
	rm -f "$EXP"
}

check_injection 0
check_injection 42