diff --git a/bindings/Python/_judger.c b/bindings/Python/_judger.c index e7f0ee0..2837b6f 100644 --- a/bindings/Python/_judger.c +++ b/bindings/Python/_judger.c @@ -100,7 +100,7 @@ static PyObject *judger_run(PyObject *self, PyObject *args, PyObject *kwargs) { } void *handler = dlopen("/usr/lib/judger/libjudger.so", RTLD_LAZY); - int (*judger_run)(struct config *, struct result *); + void (*judger_run)(struct config *, struct result *); if (!handler) { RaiseValueError("dlopen error") diff --git a/src/child.c b/src/child.c index 6743c9c..64de70b 100644 --- a/src/child.c +++ b/src/child.c @@ -39,10 +39,12 @@ void close_file(FILE *fp, ...) { int child_process(FILE *log_fp, struct config *_config) { FILE *input_file = NULL, *output_file = NULL, *error_file = NULL; - struct rlimit max_stack; - max_stack.rlim_cur = max_stack.rlim_max = (rlim_t) (_config->max_stack); - if (setrlimit(RLIMIT_STACK, &max_stack) != 0) { - CHILD_ERROR_EXIT(SETRLIMIT_FAILED); + if (_config->max_stack != UNLIMITED) { + struct rlimit max_stack; + max_stack.rlim_cur = max_stack.rlim_max = (rlim_t) (_config->max_stack); + if (setrlimit(RLIMIT_STACK, &max_stack) != 0) { + CHILD_ERROR_EXIT(SETRLIMIT_FAILED); + } } // set memory limit diff --git a/src/logger.h b/src/logger.h index 4ed391d..0905d86 100644 --- a/src/logger.h +++ b/src/logger.h @@ -19,7 +19,7 @@ void log_write(int level, const char *source_filename, const int line_number, co #define LOG_DEBUG(log_fp, x...) #endif -#define LOG_INFO(log_fp, x...) log_write(LOG_LEVEL_INFO, __FILE__ __LINE__, log_fp, ##x) +#define LOG_INFO(log_fp, x...) log_write(LOG_LEVEL_INFO, __FILE__, __LINE__, log_fp, ##x) #define LOG_WARNING(log_fp, x...) log_write(LOG_LEVEL_WARNING, __FILE__, __LINE__, log_fp, ##x) #define LOG_FATAL(log_fp, x...) log_write(LOG_LEVEL_FATAL, __FILE__, __LINE__, log_fp, ##x)