diff options
author | sanine <sanine.not@pm.me> | 2023-03-24 17:15:58 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-03-24 17:15:58 -0500 |
commit | d4786851ffa0265f534ce66f337be2c15f2358a2 (patch) | |
tree | 8aea8218c3f139fec374c9c0158b35e3764dd58e /src | |
parent | 3ecb029fedcf03d3d9eec193d91d1ed1bc6dc130 (diff) |
do chdir error checking
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -12,6 +12,7 @@ #else # include <unistd.h> #endif +#include <errno.h> void print_load_error(lua_State *L, const char *script_file, int error_type); @@ -29,6 +30,10 @@ int main(int argc, char **argv) /* configure working directory */ if (options.working_dir != NULL) { chdir(options.working_dir); + if (errno == ENOENT) { + honey_log(HONEY_FATAL, "[FATAL] could not find directory \"%s\"\n", options.working_dir); + return 1; + } } /* set up lua state */ |