From 0890d32e709b5a01153f00d29ed4c00299744f5d Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 1 Apr 2024 03:49:43 +0000 Subject: [PATCH] exit on timeout error --- ftpfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ftpfs.c b/ftpfs.c index 3d26ff4..adc3661 100644 --- a/ftpfs.c +++ b/ftpfs.c @@ -222,6 +222,12 @@ static int op_return(int err, char * operation) return 0; } fprintf(stderr, "ftpfs: operation %s failed because %s\n", operation, strerror(-err)); + if (strstr(error_buf, "timed out") != NULL + || strstr(error_buf, "timeout") != NULL + || strstr(error_buf, "time-out") != NULL) { + // try to match any curl error which would indiciate that the mount is offline. + fuse_exit(fuse_get_context()->fuse); + } return err; }