From df76ef8b99992326d9d517604cb611c2de0c0ef2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 14 Jul 2021 06:18:56 -0700 Subject: sysif: create rlim struct even without HAVE_RLIM. The reason for this change is that we don't want syntax like #S(rlim cur 0 max 0) to fail to read in a build of TXR that happens not to have detected getrlimit. * sysif.c (rlim_s, cur_s, max_s, rlim_st): Define variables unconditionally. (sysif_init): Initialize variables unconditionally. --- sysif.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sysif.c b/sysif.c index 0cd8c8f3..bf230b29 100644 --- a/sysif.c +++ b/sysif.c @@ -152,10 +152,8 @@ val flock_s, type_s, whence_s, start_s, len_s, pid_s; val dlhandle_s, dlsym_s; #endif -#if HAVE_RLIMIT val rlim_s, cur_s, max_s; static val rlim_st; -#endif struct cobj_class *dir_cls; @@ -3095,13 +3093,13 @@ void sysif_init(void) reg_varl(intern(lit("dt-lnk"), user_package), num_fast(DT_LNK)); reg_varl(intern(lit("dt-sock"), user_package), num_fast(DT_SOCK)); -#if HAVE_RLIMIT rlim_s = intern(lit("rlim"), user_package); cur_s = intern(lit("cur"), user_package); max_s = intern(lit("max"), user_package); rlim_st = make_struct_type(rlim_s, nil, nil, list(cur_s, max_s, nao), nil, nil, nil, nil); +#if HAVE_RLIMIT reg_fun(intern(lit("getrlimit"), user_package), func_n2o(getrlimit_wrap, 1)); reg_fun(intern(lit("setrlimit"), user_package), func_n2(setrlimit_wrap)); reg_varl(intern(lit("rlim-saved-max"), user_package), num_fast(RLIM_SAVED_MAX)); -- cgit v1.2.3