From 1bdde9c4f7edeb3c425d19937bcb2b9354105609 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Tue, 28 Jan 2020 23:46:14 -0600 Subject: [PATCH] Fix warnings. --- Makefile | 4 ++-- src/boot/boot.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0ac79570..dff7c925 100644 --- a/Makefile +++ b/Makefile @@ -156,10 +156,10 @@ build/janetconf.h: src/conf/janetconf.h cp $< $@ build/janet.o: build/janet.c build/janet.h build/janetconf.h - $(CC) $(LDFLAGS) $(CFLAGS) -c $< -o $@ -I build $(CLIBS) + $(CC) $(CFLAGS) -c $< -o $@ -I build build/shell.o: build/shell.c build/janet.h build/janetconf.h - $(CC) $(LDFLAGS) $(CFLAGS) -c $< -o $@ -I build $(CLIBS) + $(CC) $(CFLAGS) -c $< -o $@ -I build $(JANET_TARGET): build/janet.o build/shell.o $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(CLIBS) diff --git a/src/boot/boot.c b/src/boot/boot.c index 9cf64f2b..89822336 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -24,7 +24,7 @@ #include "tests.h" #ifdef JANET_WINDOWS -#include +#include #define chdir(x) _chdir(x) #else #include @@ -77,7 +77,11 @@ int main(int argc, const char **argv) { boot_filename = "boot.janet"; #endif - chdir(argv[1]); + int chdir_status = chdir(argv[1]); + if (chdir_status) { + fprintf(stderr, "Could not change to directory %s\n", argv[1]); + exit(1); + } FILE *boot_file = fopen("src/boot/boot.janet", "rb"); if (NULL == boot_file) {