summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-02-07 13:29:45 +0900
committerRyo Nakamura <upa@haeena.net>2024-02-07 13:29:45 +0900
commit96084004b699bd8b5abc1c37b3ef4af2e6a37e26 (patch)
treee00193e4da4538f2ee49fd19779192e45d7f70a7 /src/main.c
parent5119d5ae263be1c4e19d8bc749b7211327686945 (diff)
cleanup error message handling
The top-level funtion in a thread should print errors using priv_get_err(), while lower-level functions should set error messages using priv_set_err() except that error mesesages should be printed immediately, e.g., under walk_src_path().
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 30e6550..fae5e0d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -186,8 +186,10 @@ struct target *validate_targets(char **arg, int len)
for (n = 0; n < len; n++) {
t[n].copy =
split_user_host_path(arg[n], &t[n].user, &t[n].host, &t[n].path);
- if (!t[n].copy)
+ if (!t[n].copy) {
+ pr_err("failed to parse '%s'", arg[n]);
goto free_target_out;
+ }
}
/* check all user@host are identical. t[len - 1] is destination,
@@ -421,8 +423,6 @@ int main(int argc, char **argv)
pr_err("mscp_start: %s", priv_get_err());
ret = mscp_join(m);
- if (ret != 0)
- pr_err("mscp_join: %s", priv_get_err());
pthread_cancel(tid_stat);
pthread_join(tid_stat, NULL);