From 4de1818baf096bb28d83e4ad37372e5cbaa5093f Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Wed, 20 Nov 2019 12:06:29 +0000 Subject: [PATCH] linux: avoid overhead of P_CONTROLT checks if possible Sponsored by: The FreeBSD Foundation --- sys/compat/linux/linux_file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 6302a0538756..57723e1aafd7 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -137,6 +137,8 @@ linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mod error = ELOOP; goto done; } + if (p->p_flag & P_CONTROLT) + goto done; if (bsd_flags & O_NOCTTY) goto done;