From nobody Fri Jan 05 16:13:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T67mg42xbz55DCh; Fri, 5 Jan 2024 16:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T67mg3Xhgz4wSt; Fri, 5 Jan 2024 16:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704471219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=foB9MfoEpd40uF6JhPVXHIuSerHNiOVSXuVg/UvX3bE=; b=kv9aIpsD4pJglJ3YX4qF6xqwdaDon63Xrh2ZXUj0CqAgjWWVKiSd1H2+DdJOZ2NKsMVu8i l/idTCvJyJ3RS1PEH0dQ4nzJ14Sxyq18YLXc+BGANCVePbrj1lNOiMpXhp1Aja4taFck5E /NG8fyXNALi3bpmpIojtxuP8Bp8qoD0znehVZhv2ZU31POPT5a6oURoQtXLJ4W8gHYxkVh 1XOoPPHepK95pcb/hTs6l9IrRORoJSceQNsD6er8WnxPZR3yVw2dkj10as0nxXd8LBm/R2 Bgc+PmrYQEH5JbaKV5zCXTzcgQ4ouqbzJj7S04gPbYzNtkPA7KvqqMIlrL0m1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704471219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=foB9MfoEpd40uF6JhPVXHIuSerHNiOVSXuVg/UvX3bE=; b=ueDDdEJGHFC+gqa6DWzeuhSEU5rplJnQinypKc+dex8CVUIeAc9o3ePBCII1M59UFcZC/e VHBp0Mr4No6z2mQZwq7Dc95lpZ/Mhn2xQaw0/QTmoNRBmkOLBTrk7KkY3NeGyJvW0a72wU B5Jq1kcu3HFtETsjEQFgZB4dr5LqcSnRU2Rref+XI+V1iteQPQZoOcFHbBpBwP3yplLfXE eKx+8xKGAYfL6ty2QHzz9J2pvvq/tSeeIIPe+Jy2G16mvaezsRPELX66tXoAL8tKHGb0vl vQeKn/kcq/C7Vf94y0pIAgZCvlqdN3htrKBrLVEZjRPr/WB3ptl7eR0YHNyaxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704471219; a=rsa-sha256; cv=none; b=O3uqMa5Q06bf25jV6ldlrTdprV8Xkub27c9uACju1/D8LEpvsOlSJyyWXZePqn1cPDlDJZ LbP5q1Xyu/QG7uwK+FPtPL/ZpEDLaT+YwKnXp4q71K6AF4GAD0U+SHQb5Kc4Dzie+xe46y kdDiuNs55G3BXbnQX6m3yAr9LVa+L+iIfbKqpvs5Jpjz7BlLdiHo63I4fX/lOCOt2G5Y55 /Lww0w9vKckiN4SS/qa6XF8g+kvNxaWxZhikF4xmlr+sza3cgnUvjsCp7Hjjp8YUzbCnrL i1ve3YMuX8VijHDUgRMTRvWLcdJrilG5JgYcrrFj/ml6kJgnUtpuBN6sv9JbEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T67mg2cNHz14Y2; Fri, 5 Jan 2024 16:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 405GDds1025051; Fri, 5 Jan 2024 16:13:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 405GDdA5025048; Fri, 5 Jan 2024 16:13:39 GMT (envelope-from git) Date: Fri, 5 Jan 2024 16:13:39 GMT Message-Id: <202401051613.405GDdA5025048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: a68d5a66258e - main - Revert "kern: console: make /dev/console backing console more predictable" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a68d5a66258e953ef6ccdbdd82e89572a3cc04f9 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=a68d5a66258e953ef6ccdbdd82e89572a3cc04f9 commit a68d5a66258e953ef6ccdbdd82e89572a3cc04f9 Author: Kyle Evans AuthorDate: 2024-01-05 16:13:06 +0000 Commit: Kyle Evans CommitDate: 2024-01-05 16:13:06 +0000 Revert "kern: console: make /dev/console backing console more predictable" This accidentally snuck into a different branch, and has not been reviewed for sanity yet.. This reverts commit 8ec6d7be2e27622b8b9e192b4da9ce88a4118636. --- sys/kern/kern_cons.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index d4a858cb12fd..462cd0c45758 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -239,31 +239,15 @@ cnremove(struct consdev *cn) { struct cn_device *cnd; int i; - bool primary = true; STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) { - if (cnd->cnd_cn != cn) { - primary = false; + if (cnd->cnd_cn != cn) continue; - } - + if (STAILQ_FIRST(&cn_devlist) == cnd) + ttyconsdev_select(NULL); STAILQ_REMOVE(&cn_devlist, cnd, cn_device, cnd_next); cnd->cnd_cn = NULL; - /* - * We only need to select a new console if we've removed all - * consoles or if we're removing the primary console. - */ - if (primary) { - struct cn_device *next; - - next = STAILQ_FIRST(&cn_devlist); - if (next == NULL) - ttyconsdev_select(NULL); - else - ttyconsdev_select(next->cnd_cn->cn_name); - } - /* Remove this device from available mask. */ for (i = 0; i < CNDEVTAB_SIZE; i++) if (cnd == &cn_devtab[i]) { @@ -372,6 +356,8 @@ sysctl_kern_console(SYSCTL_HANDLER_ARGS) error = 0; } else { error = cnadd(cp); + if (error == 0) + cnselect(cp); } break; }