Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
szmi committed May 15, 2007
1 parent eff1631 commit 15f9118
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2007-05-15 Miklos Szeredi <miklos@szeredi.hu>

* Add needed g_thread_init() to fix rare crashes. Reported by
Dimitrios Apostolou

* Fix memory leak in sshfs_open_common()

2007-04-18 Miklos Szeredi <miklos@szeredi.hu>

* Fix crash within gdb, caused by sem_wait() returning with an
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
AM_CONDITIONAL(SSH_NODELAY_SO, test "$enable_sshnodelay" != "no")

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
PKG_CHECK_MODULES(SSHFS, [fuse >= 2.2 glib-2.0])
PKG_CHECK_MODULES(SSHFS, [fuse >= 2.2 glib-2.0 gthread-2.0])
have_fuse_opt_parse=no
AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes])
if test "$have_fuse_opt_parse" = no; then
Expand Down
9 changes: 7 additions & 2 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1817,8 +1817,11 @@ static int sshfs_open_common(const char *path, mode_t mode,
buf_add_path(&buf, path);
err2 = sftp_request(sshfs.follow_symlinks ? SSH_FXP_STAT : SSH_FXP_LSTAT,
&buf, SSH_FXP_ATTRS, &outbuf);
if (!err2 && buf_get_attrs(&outbuf, &stbuf, NULL) == -1)
err2 = -EIO;
if (!err2) {
if (buf_get_attrs(&outbuf, &stbuf, NULL) == -1)
err2 = -EIO;
buf_free(&outbuf);
}
err = sftp_request_wait(open_req, SSH_FXP_OPEN, SSH_FXP_HANDLE,
&sf->handle);
if (!err && err2) {
Expand Down Expand Up @@ -2605,6 +2608,8 @@ int main(int argc, char *argv[])
char *base_path;
const char *sftp_server;

g_thread_init(NULL);

sshfs.blksize = 4096;
sshfs.max_read = 65536;
sshfs.nodelay_workaround = 1;
Expand Down

0 comments on commit 15f9118

Please sign in to comment.