#define MAX_ERRNO_VALUE 4095
#define INJECT_OPTS_RVAL_DEFAULT (-(MAX_ERRNO_VALUE + 1))
-#define INJECT_OPTS_RVAL_DISABLE (INJECT_OPTS_RVAL_DEFAULT - 1)
/* Trace Control Block */
struct tcb {
error_msg_and_die("invalid %s '%s'", description, str);
}
- if (opts.rval == INJECT_OPTS_RVAL_DEFAULT) {
- /* If neither retval nor error is specified, then ... */
- if (opts.signo) {
- /* disable syscall fault injection if signal is specified. */
- opts.rval = INJECT_OPTS_RVAL_DISABLE;
- } else if (fault_tokens_only) {
- /* default error code for fault= syntax is ENOSYS */
+ /* If neither of retval, error, or signal is specified, then ... */
+ if (opts.rval == INJECT_OPTS_RVAL_DEFAULT && !opts.signo) {
+ if (fault_tokens_only) {
+ /* in fault= syntax the default error code is ENOSYS. */
opts.rval = -ENOSYS;
} else {
- /* an error has to be specified in inject= syntax. */
+ /* in inject= syntax this is not allowed. */
error_msg_and_die("invalid %s '%s'", description, str);
}
}
if (opts->signo > 0)
*signo = opts->signo;
- if (opts->rval != INJECT_OPTS_RVAL_DISABLE && !arch_set_scno(tcp, -1))
+ if (opts->rval != INJECT_OPTS_RVAL_DEFAULT && !arch_set_scno(tcp, -1))
tcp->flags |= TCB_TAMPERED;
return 0;