summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-03-24 17:15:58 -0500
committersanine <sanine.not@pm.me>2023-03-24 17:15:58 -0500
commitd4786851ffa0265f534ce66f337be2c15f2358a2 (patch)
tree8aea8218c3f139fec374c9c0158b35e3764dd58e
parent3ecb029fedcf03d3d9eec193d91d1ed1bc6dc130 (diff)
do chdir error checking
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 95eef75..357a04f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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 */