Skip to content

Commit 5aa231b

Browse files
committed
fix shellcheck identified issues, spelling and whitespace
1 parent 9700b35 commit 5aa231b

15 files changed

+63
-71
lines changed

.github/ISSUE_TEMPLATE/issue-report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PLEASE READ BEFORE REPORTING AN ISSUE
1111

1212
SSHFS does not have any active, regular contributors or developers. The current maintainer continues to apply pull requests and tries to make regular releases, but unfortunately has no capacity to do any development beyond addressing high-impact issues. When reporting bugs, please understand that unless you are including a pull request or are reporting a critical issue, you will probably not get a response.
1313

14-
To prevent the issue tracker from being flooded with issues that no-one is intending to work on, and to give more visibilty to critical issues that users should be aware of and that most urgently need attention, I will also close most bug reports once they've been inactive for a while.
14+
To prevent the issue tracker from being flooded with issues that no-one is intending to work on, and to give more visibility to critical issues that users should be aware of and that most urgently need attention, I will also close most bug reports once they've been inactive for a while.
1515

1616
Please note that this isn't meant to imply that you haven't found a bug - you most likely have and I'm grateful that you took the time to report it. Unfortunately, SSHFS is a purely volunteer driven project,
1717
and at the moment there simply aren't any volunteers.

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ addons:
1818
- libglib2.0-dev
1919
install: test/travis-install.sh
2020
script: test/travis-build.sh
21-

ChangeLog.rst

+6-10
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ Release 3.7.2 (2021-06-08)
55
tried - returning EEXIST if the access was successful.
66
Fixes: https://github.com/libfuse/sshfs/issues/243
77

8-
98
Release 3.7.1 (2020-11-09)
109
--------------------------
1110

1211
* Minor bugfixes.
1312

14-
1513
Release 3.7.0 (2020-01-03)
1614
--------------------------
1715

@@ -25,7 +23,6 @@ Release 3.7.0 (2020-01-03)
2523
needed anymore. If you depend on this workaround, please let the SSHFS maintainers know,
2624
otherwise support for the workaround will be removed completely in a future version.
2725

28-
2926
Release 3.6.0 (2019-11-03)
3027
--------------------------
3128

@@ -38,7 +35,6 @@ Release 3.6.0 (2019-11-03)
3835
* Fixed a number of compiler warnings.
3936
* Improved performance under OS X.
4037

41-
4238
Release 3.5.2 (2019-04-13)
4339
--------------------------
4440

@@ -108,13 +104,13 @@ Release 3.1.0 (2017-08-04)
108104

109105
* For improved backwards compatibility, SSHFS now also silently
110106
accepts the old ``-o cache_*`` options.
111-
107+
112108
Release 3.0.0 (2017-07-08)
113109
--------------------------
114110

115111
* sshfs now requires libfuse 3.1.0 or newer.
116112
* When supported by the kernel, sshfs now uses writeback caching.
117-
* The `cache` option has been renamed to `dir_cache` for clarity.
113+
* The `cache` option has been renamed to `dir_cache` for clarity.
118114
* Added unit tests
119115
* --debug now behaves like -o debug_sshfs, i.e. it enables sshfs
120116
debugging messages rather than libfuse debugging messages.
@@ -129,7 +125,7 @@ Release 3.0.0 (2017-07-08)
129125
* Removed support for `-o workaround=all`. Workarounds should always
130126
enabled explicitly and only when needed. There is no point in always
131127
enabling a potentially changing set of workarounds.
132-
128+
133129
Release 2.9 (2017-04-17)
134130
------------------------
135131

@@ -168,14 +164,14 @@ Release 2.4 (2012-03-08)
168164
------------------------
169165

170166
* New `slave` option.
171-
* New `idmap`, `uidmap` and `gidmap` options.
167+
* New `idmap`, `uidmap` and `gidmap` options.
172168
* Various small bugfixes.
173169

174170
Release 2.3 (2011-07-01)
175171
------------------------
176172

177173
* Support hard link creation if server is OpenSSH 5.7 or later
178-
* Small improvements and bug fixes
174+
* Small improvements and bug fixes
179175
* Check mount point and options before connecting to ssh server
180176
* New 'delay_connect' option
181177

@@ -188,7 +184,7 @@ Release 2.2 (2008-10-20)
188184
Release 2.1 (2008-07-11)
189185
------------------------
190186

191-
* Small improvements and bug fixes
187+
* Small improvements and bug fixes
192188

193189
Release 2.0 (2008-04-23)
194190
------------------------

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Normally, the default build options will work fine. If you
7272
nevertheless want to adjust them, you can do so with the *mesonconf*
7373
command::
7474

75-
$ mesonconf # list options
75+
$ mesonconf # list options
7676
$ mesonconf -D strip=true # set an option
7777

7878
To build, test and install SSHFS, you then use Ninja (running the

cache.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static void *cache_init(struct fuse_conn_info *conn,
256256
{
257257
void *res;
258258
res = cache.next_oper->init(conn, cfg);
259-
259+
260260
// Cache requires a path for each request
261261
cfg->nullpath_ok = 0;
262262

@@ -300,7 +300,6 @@ static int cache_readlink(const char *path, char *buf, size_t size)
300300
return err;
301301
}
302302

303-
304303
static int cache_opendir(const char *path, struct fuse_file_info *fi)
305304
{
306305
(void) path;
@@ -318,9 +317,9 @@ static int cache_releasedir(const char *path, struct fuse_file_info *fi)
318317
{
319318
int err;
320319
struct file_handle *cfi;
321-
320+
322321
cfi = (struct file_handle*) fi->fh;
323-
322+
324323
if(cfi->is_open) {
325324
fi->fh = cfi->fs_fh;
326325
err = cache.next_oper->releasedir(path, fi);
@@ -365,7 +364,7 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
365364
struct node *node;
366365

367366
assert(offset == 0);
368-
367+
369368
pthread_mutex_lock(&cache.lock);
370369
node = cache_lookup(path);
371370
if (node != NULL && node->dir != NULL) {
@@ -391,8 +390,8 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
391390
}
392391
cfi->is_open = 1;
393392
cfi->fs_fh = fi->fh;
394-
}
395-
393+
}
394+
396395
ch.path = path;
397396
ch.buf = buf;
398397
ch.filler = filler;

compat/fuse_opt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
/**
1919
* Option description
2020
*
21-
* This structure describes a single option, and and action associated
21+
* This structure describes a single option, and action associated
2222
* with it, in case it matches.
2323
*
2424
* More than one such match may occur, in which case the action for

make_release_tarball.sh

-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ gpg --armor --detach-sign "${TAG}.tar.xz"
2727
PREV_TAG="$(git tag --list 'sshfs-3*' --sort=-taggerdate --merged "${TAG}^"| head -1)"
2828
echo "Contributors from ${PREV_TAG} to ${TAG}:"
2929
git log --pretty="format:%an <%aE>" "${PREV_TAG}..${TAG}" | sort -u
30-

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ endif
2626

2727

2828
rst2man = find_program('rst2man', 'rst2man.py', required: false)
29-
29+
3030
cfg = configuration_data()
3131

3232
cfg.set_quoted('PACKAGE_VERSION', meson.project_version())

sshfs.c

+20-20
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
/*
142142
Handling of multiple SFTP connections
143143
--------------------------------------
144-
144+
145145
An SFTP server is free to return responses to outstanding requests in arbitrary
146146
order. However, execution of requests may only be re-ordered and parallelized as long
147147
as "the results in the responses will be the same as if [the client] had sent the
@@ -158,11 +158,11 @@
158158
involved) wait for the other requests to complete. This means that e.g. a readdir
159159
request would have to block on most other activity in the same directory, eliminating a
160160
major advantage of using multiple connections.
161-
161+
162162
In practice, we can luckily take advantage of the knowledge that most FUSE requests are
163163
the result of (synchronous) syscalls from userspace that will block until the
164164
corresponding FUSE response has been sent.
165-
165+
166166
If -o sshfs_sync is used, SSHFS always waits for the SFTP server response before
167167
returning a FUSE response to userspace. If userspace makes concurrent system calls,
168168
there is no ordering guarantee in the first place, so we do not have to worry about
@@ -523,7 +523,7 @@ static struct fuse_opt sshfs_opts[] = {
523523
/* For backwards compatibility */
524524
SSHFS_OPT("cache=yes", dir_cache, 1),
525525
SSHFS_OPT("cache=no", dir_cache, 0),
526-
526+
527527
FUSE_OPT_KEY("writeback_cache=no", FUSE_OPT_KEY_DISCARD),
528528
FUSE_OPT_KEY("unreliable_append", FUSE_OPT_KEY_DISCARD),
529529

@@ -1073,7 +1073,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
10731073

10741074
if (sshfs.max_conns == 1)
10751075
return &sshfs.conns[0];
1076-
1076+
10771077
if (sf != NULL)
10781078
return sf->conn;
10791079

@@ -1906,7 +1906,7 @@ static void *sshfs_init(struct fuse_conn_info *conn,
19061906

19071907
// SFTP only supports 1-second time resolution
19081908
conn->time_gran = 1000000000;
1909-
1909+
19101910
return NULL;
19111911
}
19121912

@@ -2371,13 +2371,13 @@ static int sshfs_mkdir(const char *path, mode_t mode)
23712371
// Commutes with pending write(), so we can use any connection
23722372
err = sftp_request(get_conn(NULL, NULL), SSH_FXP_MKDIR, &buf, SSH_FXP_STATUS, NULL);
23732373
buf_free(&buf);
2374-
2374+
23752375
if (err == -EPERM) {
23762376
if (sshfs.op->access(path, R_OK) == 0) {
23772377
return -EEXIST;
23782378
}
23792379
}
2380-
2380+
23812381
return err;
23822382
}
23832383

@@ -2394,7 +2394,7 @@ static int sshfs_mknod(const char *path, mode_t mode, dev_t rdev)
23942394

23952395
// Commutes with pending write(), so we can use any connection
23962396
conn = get_conn(NULL, NULL);
2397-
2397+
23982398
buf_init(&buf, 0);
23992399
buf_add_path(&buf, path);
24002400
buf_add_uint32(&buf, SSH_FXF_WRITE | SSH_FXF_CREAT | SSH_FXF_EXCL);
@@ -2532,7 +2532,7 @@ static int sshfs_rename(const char *from, const char *to, unsigned int flags)
25322532
}
25332533
pthread_mutex_unlock(&sshfs.lock);
25342534
}
2535-
2535+
25362536
return err;
25372537
}
25382538

@@ -2589,12 +2589,12 @@ static int sshfs_chmod(const char *path, mode_t mode,
25892589
buf_init(&buf, 0);
25902590
if (sf == NULL)
25912591
buf_add_path(&buf, path);
2592-
else
2592+
else
25932593
buf_add_buf(&buf, &sf->handle);
2594-
2594+
25952595
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_PERMISSIONS);
25962596
buf_add_uint32(&buf, mode);
2597-
2597+
25982598
/* FIXME: really needs LSETSTAT extension (debian Bug#640038) */
25992599
// Commutes with pending write(), so we can use any connection
26002600
// if the file is not open.
@@ -2618,7 +2618,7 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid,
26182618
if (!sshfs_file_is_conn(sf))
26192619
return -EIO;
26202620
}
2621-
2621+
26222622
if (sshfs.remote_uid_detected) {
26232623
if (uid == sshfs.local_uid)
26242624
uid = sshfs.remote_uid;
@@ -2635,7 +2635,7 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid,
26352635
buf_init(&buf, 0);
26362636
if (sf == NULL)
26372637
buf_add_path(&buf, path);
2638-
else
2638+
else
26392639
buf_add_buf(&buf, &sf->handle);
26402640
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_UIDGID);
26412641
buf_add_uint32(&buf, uid);
@@ -2685,7 +2685,7 @@ static int sshfs_utimens(const char *path, const struct timespec tv[2],
26852685
buf_init(&buf, 0);
26862686
if (sf == NULL)
26872687
buf_add_path(&buf, path);
2688-
else
2688+
else
26892689
buf_add_buf(&buf, &sf->handle);
26902690
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_ACMODTIME);
26912691
buf_add_uint32(&buf, asec);
@@ -2740,7 +2740,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
27402740

27412741
if (fi->flags & O_APPEND)
27422742
pflags |= SSH_FXF_APPEND;
2743-
2743+
27442744
sf = g_new0(struct sshfs_file, 1);
27452745
list_init(&sf->write_reqs);
27462746
pthread_cond_init(&sf->write_finished, NULL);
@@ -2750,7 +2750,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
27502750
pthread_mutex_lock(&sshfs.lock);
27512751
sf->modifver= sshfs.modifver;
27522752
if (sshfs.max_conns > 1) {
2753-
ce = g_hash_table_lookup(sshfs.conntab, path);
2753+
ce = g_hash_table_lookup(sshfs.conntab, path);
27542754
if (!ce) {
27552755
ce = g_malloc(sizeof(struct conntab_entry));
27562756
ce->refcount = 0;
@@ -3354,7 +3354,7 @@ static int sshfs_truncate(const char *path, off_t size,
33543354
sshfs_inc_modifver();
33553355
if (sshfs.truncate_workaround)
33563356
return sshfs_truncate_workaround(path, size, fi);
3357-
3357+
33583358
buf_init(&buf, 0);
33593359

33603360
if (sf != NULL)
@@ -3397,7 +3397,7 @@ static int sshfs_getattr(const char *path, struct stat *stbuf,
33973397
buf_add_buf(&buf, &sf->handle);
33983398
err = sftp_request(sf->conn, SSH_FXP_FSTAT, &buf,
33993399
SSH_FXP_ATTRS, &outbuf);
3400-
}
3400+
}
34013401
if (!err) {
34023402
err = buf_get_attrs(&outbuf, stbuf, NULL);
34033403
#ifdef __APPLE__

0 commit comments

Comments
 (0)