Date: Thu, 6 Mar 2008 15:14:36 +0000 (UTC) From: Sean Farley <scf@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc/stdlib getenv.c Message-ID: <200803061514.m26FEar3009851@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803061514.m26FEar3009851>