Skip to content

Commit 5dfc099

Browse files
committed
native/abnativefunctions: Use the return value of chdir()
Complements the change that adds FORTIFY_SOURCE to CPPFLAGS.
1 parent a8435c7 commit 5dfc099

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

native/abnativefunctions.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ static int abdie(WORD_LIST *list) {
368368
// cd "$SRCDIR"
369369
const auto *srcdir_v = find_variable("SRCDIR");
370370
if (srcdir_v && srcdir_v->value) {
371-
chdir(srcdir_v->value);
371+
if (chdir(srcdir_v->value) != 0) {
372+
log->logException(fmt::format("Unable to chdir() to {0}: {1}",
373+
srcdir_v->value, strerror(errno)));
374+
}
372375
}
373376
log->logDiagnostic(diag);
374377
log->logException(message ? message : std::string());

0 commit comments

Comments
 (0)