Switch from fuser to lsof
ChromeOS has no fuser, but it has lsof.
Bug: 148628514
Change-Id: I0dc97634bca5468feed8a56bf158abaa58e0f281
diff --git a/host/commands/assemble_cvd/flags.cc b/host/commands/assemble_cvd/flags.cc
index b30cedc..0ec8ea2 100644
--- a/host/commands/assemble_cvd/flags.cc
+++ b/host/commands/assemble_cvd/flags.cc
@@ -466,9 +466,9 @@
// The global link to the config file
prior_files += " " + vsoc::GetGlobalConfigFileLink();
LOG(INFO) << "Assuming prior files of " << prior_files;
- std::string fuser_cmd = "fuser " + prior_files + " 2> /dev/null";
- int rval = std::system(fuser_cmd.c_str());
- // fuser returns 0 if any of the files are open
+ std::string lsof_cmd = "lsof -t " + prior_files + " >/dev/null 2>&1";
+ int rval = std::system(lsof_cmd.c_str());
+ // lsof returns 0 if any of the files are open
if (WEXITSTATUS(rval) == 0) {
LOG(ERROR) << "Clean aborted: files are in use";
return false;