Skip to content

Commit

Permalink
musl fix (#3998)
Browse files Browse the repository at this point in the history
musl stdlib (Alpine Linux) doesn't know about canonicalize_file_name,
replace with equivalent realpath calls
  • Loading branch information
smitsohu committed Feb 24, 2021
1 parent 74c8656 commit e7eaf95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fcopy/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static char *proc_pid_to_self(const char *target) {
char *use_target = 0;
char *proc_pid = 0;

if (!(use_target = canonicalize_file_name(target)))
if (!(use_target = realpath(target, NULL)))
goto done;

// target is under /proc/<PID>?
Expand All @@ -192,7 +192,7 @@ static char *proc_pid_to_self(const char *target) {

// check where /proc/self points to
static const char proc_self[] = "/proc/self";
if (!(proc_pid = canonicalize_file_name(proc_self)))
if (!(proc_pid = realpath(proc_self, NULL)))
goto done;

// redirect /proc/PID/xxx -> /proc/self/XXX
Expand Down

0 comments on commit e7eaf95

Please sign in to comment.