Skip to content

Commit

Permalink
create klee-last as a relative link
Browse files Browse the repository at this point in the history
  • Loading branch information
danielschemmel authored and ccadar committed Feb 17, 2023
1 parent 7e0e773 commit 03a3814
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/klee/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,15 @@ KleeHandler::KleeHandler(int argc, char **argv)
SmallString<128> klee_last(directory);
llvm::sys::path::append(klee_last, "klee-last");

if (((unlink(klee_last.c_str()) < 0) && (errno != ENOENT)) ||
symlink(m_outputDirectory.c_str(), klee_last.c_str()) < 0) {
if ((unlink(klee_last.c_str()) < 0) && (errno != ENOENT)) {
klee_warning("cannot remove existing klee-last symlink: %s",
strerror(errno));
}

size_t offset = m_outputDirectory.size() -
llvm::sys::path::filename(m_outputDirectory).size();
if (symlink(m_outputDirectory.c_str() + offset, klee_last.c_str()) <
0) {
klee_warning("cannot create klee-last symlink: %s", strerror(errno));
}

Expand Down

0 comments on commit 03a3814

Please sign in to comment.