From nobody Thu Mar 06 13:59:35 2025 X-Original-To: dev-commits-src-main@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 4Z7rdN16GDz5pdsT; Thu, 06 Mar 2025 13:59:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z7rdN036Xz3tTJ; Thu, 06 Mar 2025 13:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741269576; 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=hOGC+wGBxchikOBkCC7UQAlQyUnqEvvb+CX8Xvm6leM=; b=g+mT19fSBRhJs7bbg9NGsGMEf3O7uLPlAv8a8F3FXRUwt4Ut0DhBKv5mMixFdVeSfzhUpJ hAxZETHHolG8WDTiaK6YDy0y20qDmbbTpGkJS/pzsTJqj1jrgNOxf7TJWgKKoxSXKF7vt5 saBrE51Wr+4hyWUC7PyfVBRn1vnAEfZou4zwTWC3WR/p9Me1wdcrEVFpzs85Y0kuU1X639 wfageGZrxTHOeivjpVMrlc/+pwALke8e/EpPLUJUtgotAIWCa9nYljS8uhKv9YT3Mc6h6x f5X0snsLAa1JZLK+91PYYJLnHKrTWadEsRfg3N6WNMkiuJ14BuXmWhaDs0fFzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741269576; a=rsa-sha256; cv=none; b=Frbx1zPYbN9Nsy4n6rklJ3W1Pq8WxMNOnfqHc0HTC46u24wI5f5swyRxs7aC8ixfuK4lKC jNE9oWoeJ5yrJL0TFiFqwi6aiJNacYWrHvEIiqkXVzhuTN1CZ66XowWqlUF+sCtjxJ6gOB 5+/Tzbc9BMlguUxolEFlRtBFinmlDQ/klOJrK1sykJd1hm7lq11DvoXOGKPP9uMo6yE/Ka ZRqsx2wBQrnDJhsmb8Sz8tQNipvxTA37U1/LZD05usIi1J9ohuVsXomEWTCdWfWD6g/8JC oWLUYT5DjoI8FpPclugMum5XZQpLhi8sLwwqYxzMPfIrZk3IsqScD4qxsjg/cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741269576; 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=hOGC+wGBxchikOBkCC7UQAlQyUnqEvvb+CX8Xvm6leM=; b=SHM0DcT7KPRiEbj9oAnus9epl3T3LYKHrKvG9B1Zr79BgT4mysUbQFphGfEn+3nhXbkH8+ I4iGneyrtVl+xpnUKWXNCIXVA6FCWhy+uONGuD0KIYLWNOnchQulLbPqXBBjjCiAZ3+q/1 FrWdw8rcUYthXW8roF/OLaAdS7dgINS96wpxHIyS48SNwp7iDsAHb7B3srKUImNtcNJ6I7 /9UI276YXxOXX67e8Fc311TKhw1gPZ4neV7NyEzBSJ5dLWICuK9zS/9mvx+B++KaLBClQf GqgBx3fqspuUWSDpcy4YJEOas286IYk82/FyWm3OuzIunLo7haNRxoWoXBnS0A== 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 4Z7rdM6N5mztRw; Thu, 06 Mar 2025 13:59:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 526DxZqW041088; Thu, 6 Mar 2025 13:59:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 526DxZJ1041085; Thu, 6 Mar 2025 13:59:35 GMT (envelope-from git) Date: Thu, 6 Mar 2025 13:59:35 GMT Message-Id: <202503061359.526DxZJ1041085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 180065eb09e6 - main - top: Make locale issues non-fatal. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 180065eb09e699820a1e1c45d3d00156e0effe29 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=180065eb09e699820a1e1c45d3d00156e0effe29 commit 180065eb09e699820a1e1c45d3d00156e0effe29 Author: Dag-Erling Smørgrav AuthorDate: 2025-03-06 13:43:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-03-06 13:59:23 +0000 top: Make locale issues non-fatal. If the `setlocale()` call fails, emit a warning and sleep briefly so the user has a chance to see the warning before we redraw the screen. Note that we have no way of knowing exactly what is wrong, but at least we can suggest that they check their environment. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D49230 --- usr.bin/top/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index d35d755fdc82..8712e56d43ba 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -266,8 +266,8 @@ main(int argc, const char *argv[]) #endif if (setlocale(LC_ALL, "") == NULL) { - fprintf(stderr, "invalid locale.\n"); - exit(1); + warnx("invalid locale, check your environment"); + sleep(2); } mypid = getpid();