Skip to content

Commit

Permalink
Fix crash within gdb
Browse files Browse the repository at this point in the history
  • Loading branch information
szmi committed Apr 18, 2007
1 parent dd258a5 commit 4399cfc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2007-04-18 Miklos Szeredi <miklos@szeredi.hu>

* Fix crash within gdb, caused by sem_wait() returning with an
error on interrupt. Reported by Dimitrios Apostolou

2007-02-28 Miklos Szeredi <miklos@szeredi.hu>

* Don't set DISPLAY environment variable to "", because it breaks
Expand Down
4 changes: 2 additions & 2 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4399cfc

Please sign in to comment.