Skip to content

Commit

Permalink
Fix typo causing sbin clone failure
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Jul 1, 2019
1 parent ff3710d commit 05658ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions native/jni/init/rootdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ void SARCommon::patch_rootdir() {
xreadlinkat(src, entry->d_name, buf, sizeof(buf));
xsymlinkat(buf, dest, entry->d_name);
} else {
char tpath[256];
char spath[256];
sprintf(buf, "/sbin/%s", entry->d_name);
sprintf(tpath, ROOTMIR "/sbin/%s", entry->d_name);
sprintf(spath, ROOTMIR "/sbin/%s", entry->d_name);
// Create dummy
if (S_ISDIR(st.st_mode))
xmkdir(tpath, st.st_mode & 0777);
xmkdir(buf, st.st_mode & 0777);
else
close(xopen(tpath, O_CREAT | O_WRONLY | O_CLOEXEC, st.st_mode & 0777));
xmount(tpath, buf, nullptr, MS_BIND, nullptr);
close(xopen(buf, O_CREAT | O_WRONLY | O_CLOEXEC, st.st_mode & 0777));
xmount(spath, buf, nullptr, MS_BIND, nullptr);
}
}
close(src);
Expand Down

0 comments on commit 05658ca

Please sign in to comment.