Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Dec 27, 2024
1 parent b7962f6 commit 0b44744
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/cmd/ksh93/sh/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,12 +1207,6 @@ Shell_t *sh_init(int argc,char *argv[], Shinit_f userinit)
sh.euserid = geteuid();
sh.groupid = getgid();
sh.egroupid = getegid();
sh.lim.child_max = (int)astconf_long(CONF_CHILD_MAX);
sh.lim.clk_tck = (int)astconf_long(CONF_CLK_TCK);
if(sh.lim.child_max <= 0)
sh.lim.child_max = CHILD_MAX;
if(sh.lim.clk_tck <= 0)
sh.lim.clk_tck = CLK_TCK;
sh.ed_context = ed_open();
error_info.id = path_basename(argv[0]);
umask(sh.mask = umask(0));
Expand Down Expand Up @@ -1255,6 +1249,12 @@ Shell_t *sh_init(int argc,char *argv[], Shinit_f userinit)
/* read the environment */
env_init();
astconfdisc(newconf);
sh.lim.child_max = (int)astconf_long(CONF_CHILD_MAX);
sh.lim.clk_tck = (int)astconf_long(CONF_CLK_TCK);
if(sh.lim.child_max <= 0)
sh.lim.child_max = CHILD_MAX;
if(sh.lim.clk_tck <= 0)
sh.lim.clk_tck = CLK_TCK;
if(!ENVNOD->nvalue)
{
sfprintf(sh.strbuf,"%s/.kshrc",nv_getval(HOME));
Expand Down
2 changes: 2 additions & 0 deletions src/lib/libast/include/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ extern int astquery(int, const char*, ...);
extern void astwinsize(int, int*, int*);
#if _lib_sysconf
/* prefer sysconf for astconf_long and astconf_ulong to improve performance */
#warning using sysconf for astconf_long
#define CONF_ARG_MAX _SC_ARG_MAX
#define CONF_CHILD_MAX _SC_CHILD_MAX
#define CONF_CLK_TCK _SC_CLK_TCK
Expand All @@ -308,6 +309,7 @@ extern void astwinsize(int, int*, int*);
#define astconf_ulong(x) (unsigned long)sysconf(x)
#else
/* fallback in case sysconf isn't available */
#warning using astconf fallback for astconf_long
#define CONF_ARG_MAX "ARG_MAX"
#define CONF_CHILD_MAX "CHILD_MAX"
#define CONF_CLK_TCK "CLK_TCK"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libast/port/astconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ synthesize(Feature_t* fp, const char* path, const char* value)
char* de;
char* ve;

if(getenv("_AST_DEBUG")){error(ERROR_warn(0),"[DEBUG] astconf: init state.data");abort();}
error(ERROR_warn(0),"[DEBUG] astconf: init state.data");abort();
state.prefix = strlen(state.name) + 1;
n = state.prefix + 3 * MAXVAL;
if ((s = getenv(state.name)) || getenv(state.strict) && (s = (char*)state.standard))
Expand Down

0 comments on commit 0b44744

Please sign in to comment.