diff options
Diffstat (limited to 'pkg/sshfs/patch/0005-Use-standard-C-functions.patch')
| -rw-r--r-- | pkg/sshfs/patch/0005-Use-standard-C-functions.patch | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/pkg/sshfs/patch/0005-Use-standard-C-functions.patch b/pkg/sshfs/patch/0005-Use-standard-C-functions.patch index 4da0d718..5695152c 100644 --- a/pkg/sshfs/patch/0005-Use-standard-C-functions.patch +++ b/pkg/sshfs/patch/0005-Use-standard-C-functions.patch @@ -1,17 +1,17 @@ -From 3935747a1d4c3d22db567c9bc84d3abda85cc8a8 Mon Sep 17 00:00:00 2001 +From 088c5b6b0fa85da8fdb8490f8a587631967488ad Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:42:29 -0700 Subject: [PATCH] Use standard C functions --- - sshfs.c | 89 +++++++++++++++++++++++++++++++++++++++-------------------------- - 1 file changed, 54 insertions(+), 35 deletions(-) + sshfs.c | 91 +++++++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/sshfs.c b/sshfs.c -index 19ef6b2..2882058 100644 +index 4a01e4b..3f03640 100644 --- a/sshfs.c +++ b/sshfs.c -@@ -652,25 +652,25 @@ static inline void buf_add_path(struct buffer *buf, const char *path) +@@ -654,25 +654,25 @@ static inline void buf_add_path(struct buffer *buf, const char *path) if (sshfs.base_path[0]) { if (path[1]) { if (sshfs.base_path[strlen(sshfs.base_path)-1] != '/') { @@ -47,7 +47,7 @@ index 19ef6b2..2882058 100644 } static int buf_check_get(struct buffer *buf, size_t len) -@@ -1255,7 +1255,7 @@ static void request_free(struct request *req) +@@ -1257,7 +1257,7 @@ static void request_free(struct request *req) { buf_free(&req->reply); sem_destroy(&req->ready); @@ -56,7 +56,7 @@ index 19ef6b2..2882058 100644 } static int request_table_insert(struct request_table *reqtab, struct request *req) -@@ -1303,9 +1303,9 @@ static void chunk_free(struct read_chunk *chunk) +@@ -1305,9 +1305,9 @@ static void chunk_free(struct read_chunk *chunk) rreq = list_entry(chunk->reqs.prev, struct read_req, list); list_del(&rreq->list); buf_free(&rreq->data); @@ -68,7 +68,7 @@ index 19ef6b2..2882058 100644 } static void chunk_put(struct read_chunk *chunk) -@@ -1860,8 +1860,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1862,8 +1862,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, struct request **reqp) { int err; @@ -80,18 +80,20 @@ index 19ef6b2..2882058 100644 req->want_reply = want_reply; req->end_func = end_func; req->data = data; -@@ -2557,7 +2559,9 @@ static int sshfs_open_common(const char *path, mode_t mode, - if (fi->flags & O_TRUNC) - pflags |= SSH_FXF_TRUNC; +@@ -2579,8 +2581,10 @@ static int sshfs_open_common(const char *path, mode_t mode, + if (fi->flags & O_APPEND) + pflags |= SSH_FXF_APPEND; +- - sf = g_new0(struct sshfs_file, 1); ++ + sf = calloc(1, sizeof(struct sshfs_file)); + if (!sf) + return -ENOMEM; list_init(&sf->write_reqs); pthread_cond_init(&sf->write_finished, NULL); /* Assume random read after open */ -@@ -2601,7 +2605,7 @@ static int sshfs_open_common(const char *path, mode_t mode, +@@ -2624,7 +2628,7 @@ static int sshfs_open_common(const char *path, mode_t mode, } else { if (sshfs.dir_cache) cache_invalidate(path); @@ -100,7 +102,7 @@ index 19ef6b2..2882058 100644 } buf_free(&buf); return err; -@@ -2668,7 +2672,7 @@ static void sshfs_file_put(struct sshfs_file *sf) +@@ -2691,7 +2695,7 @@ static void sshfs_file_put(struct sshfs_file *sf) { sf->refs--; if (!sf->refs) @@ -109,7 +111,7 @@ index 19ef6b2..2882058 100644 } static void sshfs_file_get(struct sshfs_file *sf) -@@ -2738,9 +2742,11 @@ static void sshfs_read_begin(struct request *req) +@@ -2761,9 +2765,11 @@ static void sshfs_read_begin(struct request *req) static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, off_t offset) { @@ -122,7 +124,7 @@ index 19ef6b2..2882058 100644 pthread_cond_init(&chunk->sio.finished, NULL); list_init(&chunk->reqs); chunk->size = size; -@@ -2754,7 +2760,9 @@ static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, +@@ -2777,7 +2783,9 @@ static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size, struct read_req *rreq; size_t bsize = size < sshfs.max_read ? size : sshfs.max_read; @@ -133,7 +135,7 @@ index 19ef6b2..2882058 100644 rreq->sio = &chunk->sio; rreq->size = bsize; buf_init(&rreq->data, 0); -@@ -2825,7 +2833,7 @@ static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) +@@ -2848,7 +2856,7 @@ static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) size -= rreq->res; list_del(&rreq->list); buf_free(&rreq->data); @@ -142,7 +144,7 @@ index 19ef6b2..2882058 100644 } } -@@ -3444,9 +3452,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3468,9 +3476,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, switch (key) { case FUSE_OPT_KEY_OPT: if (is_ssh_opt(arg)) { @@ -155,7 +157,7 @@ index 19ef6b2..2882058 100644 return 0; } /* Pass through */ -@@ -3471,9 +3480,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3495,9 +3504,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, case KEY_PORT: @@ -168,7 +170,7 @@ index 19ef6b2..2882058 100644 return 0; case KEY_COMPRESS: -@@ -3481,9 +3491,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, +@@ -3505,9 +3515,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, return 0; case KEY_CONFIGFILE: @@ -181,7 +183,7 @@ index 19ef6b2..2882058 100644 return 0; default: -@@ -3639,17 +3650,19 @@ static char *find_base_path(void) +@@ -3663,17 +3674,19 @@ static char *find_base_path(void) static char *fsname_escape_commas(char *fsnameold) { @@ -203,7 +205,7 @@ index 19ef6b2..2882058 100644 return fsname; } -@@ -3987,15 +4000,20 @@ int main(int argc, char *argv[]) +@@ -4008,15 +4021,20 @@ int main(int argc, char *argv[]) else sshfs.max_outstanding_len = ~0; @@ -228,7 +230,7 @@ index 19ef6b2..2882058 100644 ssh_add_arg(sshfs.host); if (sshfs.sftp_server) sftp_server = sshfs.sftp_server; -@@ -4022,10 +4040,11 @@ int main(int argc, char *argv[]) +@@ -4043,10 +4061,11 @@ int main(int argc, char *argv[]) sshfs.max_write = 65536; fsname = fsname_escape_commas(fsname); @@ -244,5 +246,5 @@ index 19ef6b2..2882058 100644 if(sshfs.dir_cache) sshfs.op = cache_wrap(&sshfs_oper); -- -2.14.0 +2.14.1 |
