Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
masamichitakagi committed Nov 8, 2018
2 parents bfff009 + 85c936a commit 270dd28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion executer/user/mcexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2827,17 +2827,20 @@ do_generic_syscall(
char proc_path[PATH_MAX];
char path[PATH_MAX];
struct stat sb;
int len;

sprintf(proc_path, "/proc/self/fd/%d", (int)w->sr.args[0]);

/* Get filename */
if (readlink(proc_path, path, sizeof(path)) < 0) {
if ((len = readlink(proc_path, path, sizeof(path))) < 0) {
fprintf(stderr, "%s: error: readlink() failed for %s\n",
__FUNCTION__, proc_path);
perror(": ");
goto out;
}

path[len] = 0;

/* Not in /sys? */
if (strncmp(path, "/sys/", 5))
goto out;
Expand Down

0 comments on commit 270dd28

Please sign in to comment.