| Auto-Submit | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
if (flock(config_file_lock.GetPlatformFile(), LOCK_EX | LOCK_NB) == -1) {Other usages in Chromium wrap flock() inside HANDLE_EINTR (even the ones that use LOCK_NB). Would that make sense here? Then you can remove the EAGAIN/EWOULDBLOCK check below.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +2 |
if (flock(config_file_lock.GetPlatformFile(), LOCK_EX | LOCK_NB) == -1) {Other usages in Chromium wrap flock() inside HANDLE_EINTR (even the ones that use LOCK_NB). Would that make sense here? Then you can remove the EAGAIN/EWOULDBLOCK check below.
Done. `EINTR` is for signal interruption, which is different from `EAGAIN/EWOULDBLOCK`. The check below is just to show a better error message in case the lock is held by another process.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: remoting/host/linux/daemon_process_main.cc
Insertions: 3, Deletions: 1.
@@ -13,6 +13,7 @@
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
+#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_executor.h"
@@ -88,7 +89,8 @@
// processes from using the same host config file. Only root processes can
// apply locks to the config file, and the lock will be released once the file
// descriptor is closed or the process is dead.
- if (flock(config_file_lock.GetPlatformFile(), LOCK_EX | LOCK_NB) == -1) {
+ if (HANDLE_EINTR(
+ flock(config_file_lock.GetPlatformFile(), LOCK_EX | LOCK_NB)) == -1) {
// Note: EWOULDBLOCK and EAGAIN are expanded to the same value.
PLOG(ERROR)
<< ((errno == EWOULDBLOCK || errno == EAGAIN)
```
remoting multi-process Linux: flock(2) the host config file
The single-process host's Python script prevents multiple hosts from
running by checking if the host process is running. This CL adds
something similar to the multi-process host, but instead of just
checking the process, which is fragile since it won't work for dev build
hosts, it applies an advisory file lock (flock(2)) on the host config
file.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |