Skip to content

Commit e63ff70

Browse files
committed
Some indentation fixes.
1 parent 8a70f14 commit e63ff70

30 files changed

+201
-289
lines changed

access.c

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Routines to authenticate access to a daemon (hosts allow/deny).
33
*
44
* Copyright (C) 1998 Andrew Tridgell
5-
* Copyright (C) 2004-2019 Wayne Davison
5+
* Copyright (C) 2004-2020 Wayne Davison
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -158,8 +158,7 @@ static int match_address(const char *addr, const char *tok)
158158
break;
159159

160160
#ifdef INET6
161-
case PF_INET6:
162-
{
161+
case PF_INET6: {
163162
struct sockaddr_in6 *sin6a, *sin6t;
164163

165164
sin6a = (struct sockaddr_in6 *)resa->ai_addr;
@@ -171,20 +170,19 @@ static int match_address(const char *addr, const char *tok)
171170
addrlen = 16;
172171

173172
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID
174-
if (sin6t->sin6_scope_id &&
175-
sin6a->sin6_scope_id != sin6t->sin6_scope_id) {
173+
if (sin6t->sin6_scope_id && sin6a->sin6_scope_id != sin6t->sin6_scope_id) {
176174
ret = 0;
177175
goto out;
178176
}
179177
#endif
180178

181179
break;
182-
}
180+
}
183181
#endif
184182
default:
185-
rprintf(FLOG, "unknown family %u\n", rest->ai_family);
186-
ret = 0;
187-
goto out;
183+
rprintf(FLOG, "unknown family %u\n", rest->ai_family);
184+
ret = 0;
185+
goto out;
188186
}
189187

190188
bits = -1;

acls.c

+5-10
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,12 @@ static BOOL unpack_smb_acl(SMB_ACL_T sacl, rsync_acl *racl)
332332
if (temp_ida_list.count) {
333333
#ifdef SMB_ACL_NEED_SORT
334334
if (temp_ida_list.count > 1) {
335-
qsort(temp_ida_list.items, temp_ida_list.count,
336-
sizeof (id_access), id_access_sorter);
335+
qsort(temp_ida_list.items, temp_ida_list.count, sizeof (id_access), id_access_sorter);
337336
}
338337
#endif
339338
if (!(racl->names.idas = new_array(id_access, temp_ida_list.count)))
340339
out_of_memory("unpack_smb_acl");
341-
memcpy(racl->names.idas, temp_ida_list.items,
342-
temp_ida_list.count * sizeof (id_access));
340+
memcpy(racl->names.idas, temp_ida_list.items, temp_ida_list.count * sizeof (id_access));
343341
} else
344342
racl->names.idas = NULL;
345343

@@ -825,14 +823,12 @@ void cache_tmp_acl(struct file_struct *file, stat_x *sxp)
825823
if (prior_access_count == (size_t)-1)
826824
prior_access_count = access_acl_list.count;
827825

828-
F_ACL(file) = cache_rsync_acl(sxp->acc_acl,
829-
SMB_ACL_TYPE_ACCESS, &access_acl_list);
826+
F_ACL(file) = cache_rsync_acl(sxp->acc_acl, SMB_ACL_TYPE_ACCESS, &access_acl_list);
830827

831828
if (S_ISDIR(sxp->st.st_mode)) {
832829
if (prior_default_count == (size_t)-1)
833830
prior_default_count = default_acl_list.count;
834-
F_DIR_DEFACL(file) = cache_rsync_acl(sxp->def_acl,
835-
SMB_ACL_TYPE_DEFAULT, &default_acl_list);
831+
F_DIR_DEFACL(file) = cache_rsync_acl(sxp->def_acl, SMB_ACL_TYPE_DEFAULT, &default_acl_list);
836832
}
837833
}
838834

@@ -996,8 +992,7 @@ static int set_rsync_acl(const char *fname, acl_duo *duo_item,
996992
mode = 0; /* eliminate compiler warning */
997993
#else
998994
if (type == SMB_ACL_TYPE_ACCESS) {
999-
cur_mode = change_sacl_perms(duo_item->sacl, &duo_item->racl,
1000-
cur_mode, mode);
995+
cur_mode = change_sacl_perms(duo_item->sacl, &duo_item->racl, cur_mode, mode);
1001996
if (cur_mode == (mode_t)-1)
1002997
return 0;
1003998
}

batch.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ void write_batch_shell_file(void)
289289
if (!(p = raw_argv[i]))
290290
continue;
291291
if (strncmp(p, "--files-from", 12) == 0
292-
|| strncmp(p, "--filter", 8) == 0
293-
|| strncmp(p, "--include", 9) == 0
294-
|| strncmp(p, "--exclude", 9) == 0) {
292+
|| strncmp(p, "--filter", 8) == 0
293+
|| strncmp(p, "--include", 9) == 0
294+
|| strncmp(p, "--exclude", 9) == 0) {
295295
if (strchr(p, '=') == NULL)
296296
i++;
297297
continue;

cleanup.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
172172
const char *fname = cleanup_fname;
173173
cleanup_fname = NULL;
174174
if (!partial_dir) {
175-
/* We don't want to leave a partial file with a modern time or it
176-
* could be skipped via --update. Setting the time to something
177-
* really old also helps it to stand out as unfinished in an ls. */
178-
tweak_modtime = 1;
179-
cleanup_file->modtime = 0;
175+
/* We don't want to leave a partial file with a modern time or it
176+
* could be skipped via --update. Setting the time to something
177+
* really old also helps it to stand out as unfinished in an ls. */
178+
tweak_modtime = 1;
179+
cleanup_file->modtime = 0;
180180
}
181181
finish_transfer(cleanup_new_fname, fname, NULL, NULL,
182182
cleanup_file, tweak_modtime, !partial_dir);

clientname.c

+5-8
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ static void client_sockaddr(int fd, struct sockaddr_storage *ss, socklen_t *ss_l
325325
}
326326

327327
#ifdef INET6
328-
if (GET_SOCKADDR_FAMILY(ss) == AF_INET6 &&
329-
IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss)->sin6_addr)) {
328+
if (GET_SOCKADDR_FAMILY(ss) == AF_INET6
329+
&& IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss)->sin6_addr)) {
330330
/* OK, so ss is in the IPv6 family, but it is really
331331
* an IPv4 address: something like
332332
* "::ffff:10.130.1.2". If we use it as-is, then the
@@ -349,8 +349,7 @@ static void client_sockaddr(int fd, struct sockaddr_storage *ss, socklen_t *ss_l
349349
/* There is a macro to extract the mapped part
350350
* (IN6_V4MAPPED_TO_SINADDR ?), but it does not seem
351351
* to be present in the Linux headers. */
352-
memcpy(&sin->sin_addr, &sin6.sin6_addr.s6_addr[12],
353-
sizeof sin->sin_addr);
352+
memcpy(&sin->sin_addr, &sin6.sin6_addr.s6_addr[12], sizeof sin->sin_addr);
354353
}
355354
#endif
356355
}
@@ -379,8 +378,7 @@ static int compare_addrinfo_sockaddr(const struct addrinfo *ai, const struct soc
379378
sin1 = (const struct sockaddr_in *) ss;
380379
sin2 = (const struct sockaddr_in *) ai->ai_addr;
381380

382-
return memcmp(&sin1->sin_addr, &sin2->sin_addr,
383-
sizeof sin1->sin_addr);
381+
return memcmp(&sin1->sin_addr, &sin2->sin_addr, sizeof sin1->sin_addr);
384382
}
385383

386384
#ifdef INET6
@@ -396,8 +394,7 @@ static int compare_addrinfo_sockaddr(const struct addrinfo *ai, const struct soc
396394
return 1;
397395
}
398396

399-
if (memcmp(&sin1->sin6_addr, &sin2->sin6_addr,
400-
sizeof sin1->sin6_addr))
397+
if (memcmp(&sin1->sin6_addr, &sin2->sin6_addr, sizeof sin1->sin6_addr))
401398
return 1;
402399

403400
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID

clientserver.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
123123
*p = '\0';
124124
}
125125

126-
fd = open_socket_out_wrapped(host, rsync_port, bind_address,
127-
default_af_hint);
126+
fd = open_socket_out_wrapped(host, rsync_port, bind_address, default_af_hint);
128127
if (fd == -1)
129128
exit_cleanup(RERR_SOCKETIO);
130129

@@ -755,24 +754,24 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
755754

756755
p = lp_filter(i);
757756
parse_filter_str(&daemon_filter_list, p, rule_template(FILTRULE_WORD_SPLIT),
758-
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3);
757+
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3);
759758

760759
p = lp_include_from(i);
761760
parse_filter_file(&daemon_filter_list, p, rule_template(FILTRULE_INCLUDE),
762-
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES | XFLG_FATAL_ERRORS);
761+
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES | XFLG_FATAL_ERRORS);
763762

764763
p = lp_include(i);
765764
parse_filter_str(&daemon_filter_list, p,
766-
rule_template(FILTRULE_INCLUDE | FILTRULE_WORD_SPLIT),
767-
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES);
765+
rule_template(FILTRULE_INCLUDE | FILTRULE_WORD_SPLIT),
766+
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES);
768767

769768
p = lp_exclude_from(i);
770769
parse_filter_file(&daemon_filter_list, p, rule_template(0),
771-
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES | XFLG_FATAL_ERRORS);
770+
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES | XFLG_FATAL_ERRORS);
772771

773772
p = lp_exclude(i);
774773
parse_filter_str(&daemon_filter_list, p, rule_template(FILTRULE_WORD_SPLIT),
775-
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES);
774+
XFLG_ABS_IF_SLASH | XFLG_DIR2WILD3 | XFLG_OLD_PREFIXES);
776775

777776
log_init(1);
778777

@@ -996,8 +995,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
996995
limit_output_verbosity(lp_max_verbosity(i));
997996
#endif
998997

999-
if (protocol_version < 23
1000-
&& (protocol_version == 22 || am_sender))
998+
if (protocol_version < 23 && (protocol_version == 22 || am_sender))
1001999
io_start_multiplex_out(f_out);
10021000
else if (!ret || err_msg) {
10031001
/* We have to get I/O multiplexing started so that we can

compat.c

+20-20
Original file line numberDiff line numberDiff line change
@@ -531,16 +531,16 @@ void setup_protocol(int f_out,int f_in)
531531
append_mode = 2;
532532
if (preserve_acls && !local_server) {
533533
rprintf(FERROR,
534-
"--acls requires protocol 30 or higher"
535-
" (negotiated %d).\n",
536-
protocol_version);
534+
"--acls requires protocol 30 or higher"
535+
" (negotiated %d).\n",
536+
protocol_version);
537537
exit_cleanup(RERR_PROTOCOL);
538538
}
539539
if (preserve_xattrs && !local_server) {
540540
rprintf(FERROR,
541-
"--xattrs requires protocol 30 or higher"
542-
" (negotiated %d).\n",
543-
protocol_version);
541+
"--xattrs requires protocol 30 or higher"
542+
" (negotiated %d).\n",
543+
protocol_version);
544544
exit_cleanup(RERR_PROTOCOL);
545545
}
546546
}
@@ -555,33 +555,33 @@ void setup_protocol(int f_out,int f_in)
555555
if (protocol_version < 29) {
556556
if (fuzzy_basis) {
557557
rprintf(FERROR,
558-
"--fuzzy requires protocol 29 or higher"
559-
" (negotiated %d).\n",
560-
protocol_version);
558+
"--fuzzy requires protocol 29 or higher"
559+
" (negotiated %d).\n",
560+
protocol_version);
561561
exit_cleanup(RERR_PROTOCOL);
562562
}
563563

564564
if (basis_dir_cnt && inplace) {
565565
rprintf(FERROR,
566-
"%s with --inplace requires protocol 29 or higher"
567-
" (negotiated %d).\n",
568-
alt_dest_opt(0), protocol_version);
566+
"%s with --inplace requires protocol 29 or higher"
567+
" (negotiated %d).\n",
568+
alt_dest_opt(0), protocol_version);
569569
exit_cleanup(RERR_PROTOCOL);
570570
}
571571

572572
if (basis_dir_cnt > 1) {
573573
rprintf(FERROR,
574-
"Using more than one %s option requires protocol"
575-
" 29 or higher (negotiated %d).\n",
576-
alt_dest_opt(0), protocol_version);
574+
"Using more than one %s option requires protocol"
575+
" 29 or higher (negotiated %d).\n",
576+
alt_dest_opt(0), protocol_version);
577577
exit_cleanup(RERR_PROTOCOL);
578578
}
579579

580580
if (prune_empty_dirs) {
581581
rprintf(FERROR,
582-
"--prune-empty-dirs requires protocol 29 or higher"
583-
" (negotiated %d).\n",
584-
protocol_version);
582+
"--prune-empty-dirs requires protocol 29 or higher"
583+
" (negotiated %d).\n",
584+
protocol_version);
585585
exit_cleanup(RERR_PROTOCOL);
586586
}
587587
} else if (protocol_version >= 30) {
@@ -640,8 +640,8 @@ void setup_protocol(int f_out,int f_in)
640640
if (inc_recurse && !allow_inc_recurse) {
641641
/* This should only be able to happen in a batch. */
642642
fprintf(stderr,
643-
"Incompatible options specified for inc-recursive %s.\n",
644-
read_batch ? "batch file" : "connection");
643+
"Incompatible options specified for inc-recursive %s.\n",
644+
read_batch ? "batch file" : "connection");
645645
exit_cleanup(RERR_SYNTAX);
646646
}
647647
use_safe_inc_flist = (compat_flags & CF_SAFE_FLIST) || protocol_version >= 31;

delete.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 1996-2000 Andrew Tridgell
55
* Copyright (C) 1996 Paul Mackerras
66
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
7-
* Copyright (C) 2003-2019 Wayne Davison
7+
* Copyright (C) 2003-2020 Wayne Davison
88
*
99
* This program is free software; you can redistribute it and/or modify
1010
* it under the terms of the GNU General Public License as published by
@@ -89,8 +89,8 @@ static enum delret delete_dir_contents(char *fname, uint16 flags)
8989
if (fp->flags & FLAG_MOUNT_DIR && S_ISDIR(fp->mode)) {
9090
if (DEBUG_GTE(DEL, 1)) {
9191
rprintf(FINFO,
92-
"mount point, %s, pins parent directory\n",
93-
f_name(fp, NULL));
92+
"mount point, %s, pins parent directory\n",
93+
f_name(fp, NULL));
9494
}
9595
ret = DR_NOT_EMPTY;
9696
continue;

exclude.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 1996-2001 Andrew Tridgell <tridge@samba.org>
55
* Copyright (C) 1996 Paul Mackerras
66
* Copyright (C) 2002 Martin Pool
7-
* Copyright (C) 2003-2019 Wayne Davison
7+
* Copyright (C) 2003-2020 Wayne Davison
88
*
99
* This program is free software; you can redistribute it and/or modify
1010
* it under the terms of the GNU General Public License as published by
@@ -1406,8 +1406,7 @@ void recv_filter_list(int f_in)
14061406
char line[BIGPATHBUFLEN];
14071407
int xflags = protocol_version >= 29 ? 0 : XFLG_OLD_PREFIXES;
14081408
int receiver_wants_list = prune_empty_dirs
1409-
|| (delete_mode
1410-
&& (!delete_excluded || protocol_version >= 29));
1409+
|| (delete_mode && (!delete_excluded || protocol_version >= 29));
14111410
unsigned int len;
14121411

14131412
if (!local_server && (am_sender || receiver_wants_list)) {

0 commit comments

Comments
 (0)