diff options
Diffstat (limited to 'common/cmd_nvedit.c')
-rw-r--r-- | common/cmd_nvedit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index c3b57f2..f8c7976 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -111,7 +111,7 @@ static int env_print(char *name) e.key = name; e.data = NULL; - ep = hsearch (e, FIND); + hsearch_r(e, FIND, &ep, &env_htab); if (ep == NULL) return 0; len = printf ("%s=%s\n", ep->key, ep->data); @@ -119,7 +119,7 @@ static int env_print(char *name) } /* print whole list */ - len = hexport('\n', &res, 0); + len = hexport_r(&env_htab, '\n', &res, 0); if (len > 0) { puts(res); @@ -184,7 +184,7 @@ int _do_env_set (int flag, int argc, char * const argv[]) */ e.key = name; e.data = NULL; - ep = hsearch (e, FIND); + hsearch_r(e, FIND, &ep, &env_htab); /* Check for console redirection */ if (strcmp(name,"stdin") == 0) { @@ -267,7 +267,7 @@ int _do_env_set (int flag, int argc, char * const argv[]) /* Delete only ? */ if ((argc < 3) || argv[2] == NULL) { - int rc = hdelete(name); + int rc = hdelete_r(name, &env_htab); return !rc; } @@ -293,7 +293,7 @@ int _do_env_set (int flag, int argc, char * const argv[]) e.key = name; e.data = value; - ep = hsearch(e, ENTER); + hsearch_r(e, ENTER, &ep, &env_htab); free(value); if (!ep) { printf("## Error inserting \"%s\" variable, errno=%d\n", @@ -456,7 +456,7 @@ char *getenv (char *name) e.key = name; e.data = NULL; - ep = hsearch (e, FIND); + hsearch_r(e, FIND, &ep, &env_htab); return (ep ? ep->data : NULL); } @@ -651,7 +651,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv } if (sep) { /* export as text file */ - len = hexport(sep, &addr, size); + len = hexport_r(&env_htab, sep, &addr, size); if (len < 0) { error("Cannot export environment: errno = %d\n", errno); @@ -670,7 +670,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv else /* export as raw binary data */ res = addr; - len = hexport('\0', &res, ENV_SIZE); + len = hexport_r(&env_htab, '\0', &res, ENV_SIZE); if (len < 0) { error("Cannot export environment: errno = %d\n", errno); @@ -790,7 +790,7 @@ static int do_env_import(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg addr = (char *)ep->data; } - if (himport(addr, size, sep, del ? 0 : H_NOCLEAR) == 0) { + if (himport_r(&env_htab, addr, size, sep, del ? 0 : H_NOCLEAR) == 0) { error("Environment import failed: errno = %d\n", errno); return 1; } |