Date: Wed, 4 Jul 2007 00:00:41 +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/bin/df df.c src/bin/sh var.c src/include stdlib.h src/libexec/pppoed pppoed.c src/sys/sys param.h src/lib/libc/stdlib Makefile.inc getenv.3 getenv.c putenv.c setenv.c src/tools/regression/environ Makefile Makefile.envctl ... Message-ID: <200707040000.l6400gLs044775@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
scf 2007-07-04 00:00:41 UTC FreeBSD src repository Modified files: bin/df df.c bin/sh var.c include stdlib.h libexec/pppoed pppoed.c sys/sys param.h lib/libc/stdlib Makefile.inc getenv.3 getenv.c usr.bin/du du.c usr.bin/env env.c usr.bin/limits limits.c usr.bin/login login.c usr.bin/su su.c usr.sbin/pstat pstat.c usr.sbin/sade main.c variable.c usr.sbin/sysinstall main.c variable.c Added files: tools/regression/environ Makefile Makefile.envctl Makefile.retention Makefile.timings envctl.c envtest.t retention.c timings.c Removed files: lib/libc/stdlib putenv.c setenv.c Log: Significantly reduce the memory leak as noted in BUGS section for setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Revision Changes Path 1.71 +4 -4 src/bin/df/df.c 1.36 +13 -3 src/bin/sh/var.c 1.65 +2 -2 src/include/stdlib.h 1.54 +4 -4 src/lib/libc/stdlib/Makefile.inc 1.27 +80 -24 src/lib/libc/stdlib/getenv.3 1.9 +539 -60 src/lib/libc/stdlib/getenv.c 1.7 +0 -56 src/lib/libc/stdlib/putenv.c (dead) 1.15 +0 -116 src/lib/libc/stdlib/setenv.c (dead) 1.27 +4 -4 src/libexec/pppoed/pppoed.c 1.305 +1 -1 src/sys/sys/param.h 1.1 +14 -0 src/tools/regression/environ/Makefile (new) 1.1 +16 -0 src/tools/regression/environ/Makefile.envctl (new) 1.1 +16 -0 src/tools/regression/environ/Makefile.retention (new) 1.1 +16 -0 src/tools/regression/environ/Makefile.timings (new) 1.1 +154 -0 src/tools/regression/environ/envctl.c (new) 1.1 +182 -0 src/tools/regression/environ/envtest.t (new) 1.1 +109 -0 src/tools/regression/environ/retention.c (new) 1.1 +195 -0 src/tools/regression/environ/timings.c (new) 1.42 +3 -3 src/usr.bin/du/du.c 1.19 +6 -1 src/usr.bin/env/env.c 1.17 +8 -2 src/usr.bin/limits/limits.c 1.106 +5 -2 src/usr.bin/login/login.c 1.86 +6 -2 src/usr.bin/su/su.c 1.102 +3 -3 src/usr.sbin/pstat/pstat.c 1.80 +1 -1 src/usr.sbin/sade/main.c 1.42 +4 -1 src/usr.sbin/sade/variable.c 1.77 +1 -1 src/usr.sbin/sysinstall/main.c 1.40 +4 -1 src/usr.sbin/sysinstall/variable.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707040000.l6400gLs044775>