From 4399cfca84e9250aec1d78a2719857c054631a63 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 18 Apr 2007 09:44:08 +0000 Subject: Fix crash within gdb --- ChangeLog | 5 +++++ sshfs.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4fe578..062aaf7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-18 Miklos Szeredi + + * Fix crash within gdb, caused by sem_wait() returning with an + error on interrupt. Reported by Dimitrios Apostolou + 2007-02-28 Miklos Szeredi * Don't set DISPLAY environment variable to "", because it breaks diff --git a/sshfs.c b/sshfs.c index 38176e3..b20d6e1 100644 --- a/sshfs.c +++ b/sshfs.c @@ -1299,7 +1299,7 @@ static int sftp_request_wait(struct request *req, uint8_t type, err = req->error; goto out; } - sem_wait(&req->ready); + while (sem_wait(&req->ready)); if (req->error) { err = req->error; goto out; @@ -2021,7 +2021,7 @@ static void submit_read(struct sshfs_file *sf, size_t size, off_t offset, static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) { int res; - sem_wait(&chunk->ready); + while (sem_wait(&chunk->ready)); res = chunk->res; if (res > 0) { if ((size_t) res > size) -- cgit v1.2.3