Don't ignore return value from getcwd()

This commit is contained in:
Matt Pharr
2011-12-05 09:26:33 -08:00
parent d748c501c9
commit 455d963962
2 changed files with 4 additions and 2 deletions

View File

@@ -25,7 +25,8 @@ BUILD_VERSION=$(shell git log --abbrev-commit --abbrev=16 | head -1)
CXX=g++
CPP=cpp
CXXFLAGS=-g3 $(LLVM_CXXFLAGS) -I. -Iobjs/ -Wall $(LLVM_VERSION_DEF) \
OPT=-g3
CXXFLAGS=$(OPT) $(LLVM_CXXFLAGS) -I. -Iobjs/ -Wall $(LLVM_VERSION_DEF) \
-DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_VERSION="\"$(BUILD_VERSION)\""
LDFLAGS=

View File

@@ -353,7 +353,8 @@ Globals::Globals() {
#ifdef ISPC_IS_WINDOWS
_getcwd(currentDirectory, sizeof(currentDirectory));
#else
getcwd(currentDirectory, sizeof(currentDirectory));
if (getcwd(currentDirectory, sizeof(currentDirectory)) == NULL)
FATAL("Current directory path too long!");
#endif
}