From owner-cvs-src@FreeBSD.ORG Thu Mar 6 15:14:36 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBBA3106566C; Thu, 6 Mar 2008 15:14:36 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DB5128FC15; Thu, 6 Mar 2008 15:14:36 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m26FEavL009852; Thu, 6 Mar 2008 15:14:36 GMT (envelope-from scf@repoman.freebsd.org) Received: (from scf@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m26FEar3009851; Thu, 6 Mar 2008 15:14:36 GMT (envelope-from scf) Message-Id: <200803061514.m26FEar3009851@repoman.freebsd.org> From: Sean Farley Date: Thu, 6 Mar 2008 15:14:36 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_7 Cc: Subject: cvs commit: src/lib/libc/stdlib getenv.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2008 15:14:37 -0000 scf 2008-03-06 15:14:36 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) lib/libc/stdlib getenv.c Log: MFC: Replace the use of warnx() with direct output to stderr using _write(). This reduces the size of a statically-linked binary by approximately 100KB in a trivial "return (0)" test application. readelf -S was used to verify that the .text section was reduced and that using strlen() saved a few more bytes over using sizeof(). Since the section of code is only called when environ is corrupt (program bug), I went with fewer bytes over fewer cycles. I made minor edits to the submitted patch to make the output resemble warnx(). src/lib/libc/stdlib/getenv.c: rev 1.12 -> 1.13 Submitted by: kib bz Approved by: wes (mentor) Revision Changes Path 1.12.2.1 +36 -12 src/lib/libc/stdlib/getenv.c