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; }