From b3aac4e035e572e4fc01ad32e2fe936e40ab5b09 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 4 Mar 2005 11:22:31 +0000 Subject: whitespace fix --- cache.c | 14 +++++++------- opts.c | 3 +-- sshfs.c | 28 ++++++++++++++-------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/cache.c b/cache.c index b3ccd60..ff74199 100644 --- a/cache.c +++ b/cache.c @@ -77,12 +77,12 @@ static void cache_clean(void) static struct node *cache_lookup(const char *path) { - return (struct node *) g_hash_table_lookup(cache, path); + return (struct node *) g_hash_table_lookup(cache, path); } static void cache_purge(const char *path) { - g_hash_table_remove(cache, path); + g_hash_table_remove(cache, path); } static void cache_purge_parent(const char *path) @@ -196,7 +196,7 @@ static int cache_getattr(const char *path, struct stat *stbuf) { struct node *node; int err; - + pthread_mutex_lock(&cache_lock); node = cache_lookup(path); if (node != NULL) { @@ -219,7 +219,7 @@ static int cache_readlink(const char *path, char *buf, size_t size) { struct node *node; int err; - + pthread_mutex_lock(&cache_lock); node = cache_lookup(path); if (node != NULL) { @@ -236,7 +236,7 @@ static int cache_readlink(const char *path, char *buf, size_t size) if (!err) cache_add_link(path, buf, size); - return err; + return err; } static int cache_dirfill(fuse_cache_dirh_t ch, const char *name, @@ -272,7 +272,7 @@ static int cache_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler) } } pthread_mutex_unlock(&cache_lock); - + ch.path = path; ch.h = h; ch.filler = filler; @@ -501,7 +501,7 @@ int cache_parse_options(int *argcp, char *argv[]) process_options(argcp, argv, cache_opts, 1); if (cache_opts[COPT_CACHE].present) { char *val = cache_opts[COPT_CACHE].value; - if (!val || !val[0] || + if (!val || !val[0] || (strcmp(val, "yes") != 0 && strcmp(val, "no") != 0)) { fprintf(stderr, "Invalid or missing value for 'cache' option\n"); return -1; diff --git a/opts.c b/opts.c index 373e5b6..4495b80 100644 --- a/opts.c +++ b/opts.c @@ -68,7 +68,7 @@ static int process_option_group(char *arg, struct opt opts[], return remove; } -void process_options(int *argcp, char *argv[], struct opt opts[], +void process_options(int *argcp, char *argv[], struct opt opts[], int case_sensitive) { int argctr; @@ -89,7 +89,6 @@ void process_options(int *argcp, char *argv[], struct opt opts[], g_free(argv[argctr-1]); else if (argctr != newargctr) argv[newargctr++] = argv[argctr-1]; - } } } diff --git a/sshfs.c b/sshfs.c index c195838..39ffc4e 100644 --- a/sshfs.c +++ b/sshfs.c @@ -382,7 +382,7 @@ static int buf_check_get(struct buffer *buf, size_t len) fprintf(stderr, "buffer too short\n"); return -1; } else - return 0; + return 0; } static inline int buf_get_mem(struct buffer *buf, void *data, size_t len) @@ -468,7 +468,7 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf) if (buf_get_uint32(buf, &atime) == -1 || buf_get_uint32(buf, &mtime) == -1) return -1; - } + } if ((flags & SSH_FILEXFER_ATTR_EXTENDED)) { uint32_t extcount; unsigned i; @@ -503,7 +503,7 @@ static int buf_get_entries(struct buffer *buf, fuse_cache_dirh_t h, if (buf_get_uint32(buf, &count) == -1) return -1; - + for (i = 0; i < count; i++) { int err = -1; char *name; @@ -829,7 +829,7 @@ static int sftp_request_common(uint8_t type, const struct buffer *buf, pthread_mutex_unlock(&lock); if (err) goto out; - + err = -EIO; if (sftp_send(type, &buf2) == -1) { pthread_mutex_lock(&lock); @@ -852,7 +852,7 @@ static int sftp_request_common(uint8_t type, const struct buffer *buf, uint32_t serr; if (buf_get_uint32(&req->reply, &serr) == -1) goto out; - + switch (serr) { case SSH_FX_OK: if (expect_type == SSH_FXP_STATUS) @@ -869,7 +869,7 @@ static int sftp_request_common(uint8_t type, const struct buffer *buf, break; case SSH_FX_NO_SUCH_FILE: err = -ENOENT; break; - case SSH_FX_PERMISSION_DENIED: err = -EACCES; break; + case SSH_FX_PERMISSION_DENIED: err = -EACCES; break; case SSH_FX_FAILURE: err = -EPERM; break; case SSH_FX_BAD_MESSAGE: default: err = -EPROTO; break; @@ -885,7 +885,7 @@ static int sftp_request_common(uint8_t type, const struct buffer *buf, end_func(req); buf_free(&buf2); request_free(req); - return err; + return err; } static int sftp_request(uint8_t type, const struct buffer *buf, @@ -967,7 +967,7 @@ static int sshfs_getdir(const char *path, fuse_cache_dirh_t h, } while (!err); if (err == MY_EOF) err = 0; - + err2 = sftp_request(SSH_FXP_CLOSE, &handle, 0, NULL); if (!err) err = err2; @@ -1227,7 +1227,7 @@ static int sshfs_sync_read(struct sshfs_file *sf, char *rbuf, size_t size, } else if (err == MY_EOF) err = 0; buf_free(&buf); - return err; + return err; } static void sshfs_read_end(struct request *req) @@ -1282,7 +1282,7 @@ static int sshfs_send_async_read(struct sshfs_file *sf, err = sftp_request_async(SSH_FXP_READ, &buf, sshfs_read_begin, sshfs_read_end, chunk); buf_free(&buf); - return err; + return err; } static int submit_read(struct sshfs_file *sf, size_t size, off_t offset, @@ -1305,7 +1305,7 @@ static int submit_read(struct sshfs_file *sf, size_t size, off_t offset, } else chunk_put(chunk); - return err; + return err; } static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size) @@ -1438,7 +1438,7 @@ static int sshfs_write(const char *path, const char *wbuf, size_t size, buf_add_uint64(&buf, offset); buf_add_data(&buf, &data); if (!sync_write && !sf->write_error) - err = sftp_request_async(SSH_FXP_WRITE, &buf, sshfs_write_begin, + err = sftp_request_async(SSH_FXP_WRITE, &buf, sshfs_write_begin, sshfs_write_end, sf); else err = sftp_request(SSH_FXP_WRITE, &buf, SSH_FXP_STATUS, NULL); @@ -1568,7 +1568,7 @@ int main(int argc, char *argv[]) help: usage(argv[0]); break; - + case 'C': if (!arg[2]) arg = "-oCompression=yes"; @@ -1618,7 +1618,7 @@ int main(int argc, char *argv[]) unsigned val; if (opt_get_unsigned(&sshfs_opts[SOPT_MAX_READ], &val) == -1) exit(1); - + if (val < max_read) max_read = val; } -- cgit v1.2.3