Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print errors to stderr #41

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cut_body_after = "" # don't include text from the PR body in the merge commit message
status = [
"Evaluate flake.nix",
"check smoketest [x86_64-linux]",
"package default [x86_64-linux]",
"package nix-ld [x86_64-linux]"
]
6 changes: 3 additions & 3 deletions src/nix-ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ static inline void munmapp(mmap_t *m) {

static void log_error(struct ld_ctx *ctx, const char *format, ...) {
va_list args;
printf("cannot execute %s: ", ctx->prog_name);
fprintf(stderr, "cannot execute %s: ", ctx->prog_name);

va_start(args, format);
vfprintf(stdout, format, args);
vfprintf(stderr, format, args);
va_end(args);

// cannot overflow because vsnprintf leaves space for the null byte
printf("\n");
fprintf(stderr, "\n");
}

static char *get_env(char* env, const char* key) {
Expand Down