diff options
Diffstat (limited to 'sys/kern/kern_jail.c')
-rw-r--r-- | sys/kern/kern_jail.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index ded2379acbfa..4882e8e83eb6 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -584,12 +584,15 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) gotchildmax = 1; error = vfs_copyopt(opts, "enforce_statfs", &enforce, sizeof(enforce)); - gotenforce = (error == 0); - if (gotenforce) { - if (enforce < 0 || enforce > 2) - return (EINVAL); - } else if (error != ENOENT) + if (error == ENOENT) + gotenforce = 0; + else if (error != 0) goto done_free; + else if (enforce < 0 || enforce > 2) { + error = EINVAL; + goto done_free; + } else + gotenforce = 1; pr_flags = ch_flags = 0; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); |