FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Explain why cwd is unconditionally made a mount point. · codemod/bazel-java@b599d81 · GitHub

Repository navigation

Commit b599d81

Browse files
authored andcommitted
Explain why cwd is unconditionally made a mount point.
RELNOTES: None. PiperOrigin-RevId: 580089095 Change-Id: I3ee319c6f4e7da86753d1cd12bfe3b9d43a7191c
1 parent 80edda5 commit b599d81

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎src/main/tools/linux-sandbox-pid1.cc‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,9 @@ static void MountFilesystems() {
322322
}
323323
}
324324

325-
// Make sure that our working directory is a mount point. The easiest way to
326-
// do this is by bind-mounting it upon itself.
325+
// Make sure that the working directory is writable (unlike most of the rest
326+
// of the file system, which is read-only by default). The easiest way to do
327+
// this is by bind-mounting it upon itself.
327328
PRINT_DEBUG("working dir: %s", opt.working_dir.c_str());
328329

329330
if (mount(opt.working_dir.c_str(), opt.working_dir.c_str(), nullptr, MS_BIND,
@@ -622,13 +623,15 @@ static void MountAllMounts() {
622623
}
623624
}
624625

625-
// Make sure that our working directory is a mount point. The easiest way to
626-
// do this is by bind-mounting it upon itself.
626+
// Make sure that the working directory is writable (unlike most of the rest
627+
// of the file system, which is read-only by default). The easiest way to do
628+
// this is by bind-mounting it upon itself.
627629
if (mount(opt.working_dir.c_str(), opt.working_dir.c_str(), nullptr, MS_BIND,
628630
nullptr) < 0) {
629631
DIE("mount(%s, %s, nullptr, MS_BIND, nullptr)", opt.working_dir.c_str(),
630632
opt.working_dir.c_str());
631633
}
634+
632635
for (int i = 0; i < (signed)opt.bind_mount_sources.size(); i++) {
633636
if (global_debug) {
634637
if (strcmp(opt.bind_mount_sources[i].c_str(),

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL