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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to