aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-09-15 16:12:02 +0200
committerOmar Polo <op@omarpolo.com>2021-09-15 16:12:02 +0200
commit2b409042b17a5f12c9138df589881e336798f862 (patch)
tree6a4d331708607b304af48db493c7192dc3950f91
parent55ccd6d096be150da4ea2ad1d4aa6bd60059fb0f (diff)
downloadtelescope-2b409042b17a5f12c9138df589881e336798f862.tar.gz
telescope-2b409042b17a5f12c9138df589881e336798f862.tar.bz2
ignore the crashed file if in safe_mode
During safe_mode the fs process shouldn't open or unlink the crashed_file.
-rw-r--r--fs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs.c b/fs.c
index f2c7555..fdecab1 100644
--- a/fs.c
+++ b/fs.c
@@ -316,7 +316,8 @@ handle_get_file(struct imsg *imsg, size_t datalen)
static void
handle_quit(struct imsg *imsg, size_t datalen)
{
- unlink(crashed_file);
+ if (!safe_mode)
+ unlink(crashed_file);
event_loopbreak();
}
@@ -605,6 +606,9 @@ last_time_crashed(void)
{
int fd, crashed = 1;
+ if (safe_mode)
+ return 0;
+
if (unlink(crashed_file) == -1 && errno == ENOENT)
crashed = 0;