From owner-svn-src-head@freebsd.org Wed Dec 6 02:00:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48FB1E8B8CA; Wed, 6 Dec 2017 02:00:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 229487D993; Wed, 6 Dec 2017 02:00:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB6201Wq032294; Wed, 6 Dec 2017 02:00:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB620059032287; Wed, 6 Dec 2017 02:00:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712060200.vB620059032287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 6 Dec 2017 02:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326609 - in head: stand/libsa stand/userboot stand/userboot/test stand/userboot/userboot usr.sbin/bhyveload X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: stand/libsa stand/userboot stand/userboot/test stand/userboot/userboot usr.sbin/bhyveload X-SVN-Commit-Revision: 326609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 02:00:02 -0000 Author: imp Date: Wed Dec 6 02:00:00 2017 New Revision: 326609 URL: https://svnweb.freebsd.org/changeset/base/326609 Log: Make putenv and getenv match the userland definition of these functions, tweak man page and one variable that shouldn't be const anymore. Sponsored by: Netflix Modified: head/stand/libsa/environment.c head/stand/libsa/libstand.3 head/stand/libsa/stand.h head/stand/userboot/test/test.c head/stand/userboot/userboot.h head/stand/userboot/userboot/main.c head/usr.sbin/bhyveload/bhyveload.c Modified: head/stand/libsa/environment.c ============================================================================== --- head/stand/libsa/environment.c Wed Dec 6 00:44:49 2017 (r326608) +++ head/stand/libsa/environment.c Wed Dec 6 02:00:00 2017 (r326609) @@ -162,7 +162,7 @@ setenv(const char *name, const char *value, int overwr } int -putenv(const char *string) +putenv(char *string) { char *value, *copy; int result; Modified: head/stand/libsa/libstand.3 ============================================================================== --- head/stand/libsa/libstand.3 Wed Dec 6 00:44:49 2017 (r326608) +++ head/stand/libsa/libstand.3 Wed Dec 6 02:00:00 2017 (r326609) @@ -110,7 +110,7 @@ for set/unset hook functions. .Xc .It Xo .Ft int -.Fn putenv "const char *string" +.Fn putenv "char *string" .Xc .It Xo .Ft int Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Wed Dec 6 00:44:49 2017 (r326608) +++ head/stand/libsa/stand.h Wed Dec 6 02:00:00 2017 (r326609) @@ -330,7 +330,7 @@ extern int env_setenv(const char *name, int flags, extern char *getenv(const char *name); extern int setenv(const char *name, const char *value, int overwrite); -extern int putenv(const char *string); +extern int putenv(char *string); extern int unsetenv(const char *name); extern ev_sethook_t env_noset; /* refuse set operation */ Modified: head/stand/userboot/test/test.c ============================================================================== --- head/stand/userboot/test/test.c Wed Dec 6 00:44:49 2017 (r326608) +++ head/stand/userboot/test/test.c Wed Dec 6 02:00:00 2017 (r326609) @@ -367,10 +367,10 @@ test_getmem(void *arg, uint64_t *lowmem, uint64_t *hig *highmem = 0; } -const char * +char * test_getenv(void *arg, int idx) { - static const char *vars[] = { + static char *vars[] = { "foo=bar", "bar=barbar", NULL Modified: head/stand/userboot/userboot.h ============================================================================== --- head/stand/userboot/userboot.h Wed Dec 6 00:44:49 2017 (r326608) +++ head/stand/userboot/userboot.h Wed Dec 6 02:00:00 2017 (r326609) @@ -202,7 +202,7 @@ struct loader_callbacks { * environment variable to return next. It will begin at 0 and * each invocation will add 1 to the previous value of 'num'. */ - const char * (*getenv)(void *arg, int num); + char * (*getenv)(void *arg, int num); /* * Version 4 additions. Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Wed Dec 6 00:44:49 2017 (r326608) +++ head/stand/userboot/userboot/main.c Wed Dec 6 02:00:00 2017 (r326609) @@ -78,7 +78,7 @@ void loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) { static char mallocbuf[MALLOCSZ]; - const char *var; + char *var; int i; if (version < USERBOOT_VERSION) Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Wed Dec 6 00:44:49 2017 (r326608) +++ head/usr.sbin/bhyveload/bhyveload.c Wed Dec 6 02:00:00 2017 (r326609) @@ -529,7 +529,7 @@ addenv(const char *str) SLIST_INSERT_HEAD(&envhead, env, next); } -static const char * +static char * cb_getenv(void *arg, int num) { int i;