Skip to content

Commit 75e8a4c

Browse files
committed
client_t.c: fix clang warning
Fix: client_t.c:601:25: warning: address of array 'client->client_uid' will always evaluate to 'true' [-Wpointer-bool-conversion] 601 | if (client->client_uid) { | ~~ ~~~~~~~~^~~~~~~~~~ Signed-off-by: Yaniv Kaul <[email protected]> client.c/h: clang-format fixes
1 parent 606dbd0 commit 75e8a4c

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

libglusterfs/src/client_t.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,8 @@ gf_client_dump_fdtables(xlator_t *this)
598598
clienttable->cliententries[count].next_free)
599599
continue;
600600
client = clienttable->cliententries[count].client;
601-
if (client->client_uid) {
602-
gf_proc_dump_build_key(key, "conn", "%d.id", count);
603-
gf_proc_dump_write(key, "%s", client->client_uid);
604-
}
601+
gf_proc_dump_build_key(key, "conn", "%d.id", count);
602+
gf_proc_dump_write(key, "%s", client->client_uid);
605603

606604
if (client->subdir_mount) {
607605
gf_proc_dump_build_key(key, "conn", "%d.subdir", count);

xlators/protocol/client/src/client.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ typedef struct clnt_conf {
9595
rpc_clnt_prog_t *dump;
9696

9797
int client_id;
98-
int event_threads; /* # of event threads
99-
* configured */
98+
int event_threads; /* # of event threads
99+
* configured */
100100
uint64_t reopen_fd_count; /* Count of fds reopened after a
101101
connection is established */
102102
gf_lock_t rec_lock;
@@ -123,7 +123,7 @@ typedef struct clnt_conf {
123123
*/
124124
gf_boolean_t filter_o_direct; /* if set, filter O_DIRECT from
125125
the flags list of open() */
126-
gf_boolean_t send_gids; /* let the server resolve gids */
126+
gf_boolean_t send_gids; /* let the server resolve gids */
127127

128128
gf_boolean_t destroy; /* if enabled implies fini was called
129129
* on @this xlator instance */
@@ -136,7 +136,7 @@ typedef struct clnt_conf {
136136
* logged
137137
*/
138138

139-
gf_boolean_t old_protocol; /* used only for old-protocol testing */
139+
gf_boolean_t old_protocol; /* used only for old-protocol testing */
140140
gf_boolean_t fini_completed;
141141
gf_boolean_t strict_locks; /* When set, doesn't reopen saved fds after
142142
reconnect if POSIX locks are held on them.
@@ -145,8 +145,8 @@ typedef struct clnt_conf {
145145
complaince as bricks cleanup any granted
146146
locks when a client disconnects.
147147
*/
148-
gf_boolean_t connection_to_brick; /*True from attempt to connect to brick
149-
till disconnection to brick*/
148+
gf_boolean_t connection_to_brick; /*True from attempt to connect to brick
149+
till disconnection to brick*/
150150
pthread_cond_t fini_complete_cond; /* Used to wait till we finsh the fini
151151
compltely, ie client_fini_complete
152152
to return*/

0 commit comments

Comments
 (0)