[PATCH v1 4/4] tests: check decoding of successful quotactl

Dmitry V. Levin ldv at altlinux.org
Tue Jul 10 11:49:45 UTC 2018


On Mon, Jul 09, 2018 at 12:11:32AM +0800, Zhibin Li wrote:
[...]
> diff --git a/tests/quotactl.h b/tests/quotactl.h
> index 352f9270..087747cc 100644
> --- a/tests/quotactl.h
> +++ b/tests/quotactl.h
> @@ -78,6 +78,7 @@ enum check_quotactl_flags {
>  	CQF_ADDR_CB   = 1 << CQF_ADDR_CB_BIT,
>  };
>  
> +static const char *errstr;
>  
>  static inline void
>  check_quota(uint32_t flags, int cmd, const char *cmd_str,
> @@ -116,6 +117,21 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str,
>  	va_end(ap);
>  
>  	rc = syscall(__NR_quotactl, cmd, special, id, addr);
> +
> +	errstr = sprintrc(rc);
> +
> +#ifdef INJECT_RETVAL
> +	if (rc != INJECT_RETVAL)
> +		error_msg_and_fail("Got a return value of %ld != %d",
> +				   rc, INJECT_RETVAL);
> +
> +	static char inj_errstr[4096];
> +
> +	snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr);
> +	errstr = inj_errstr;
> +	addr_cb_arg = 0;

Why addr_cb_arg is being cleared here?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20180710/8246e159/attachment.bin>


More information about the Strace-devel mailing list