summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-05-07 21:05:05 +0900
committerRyo Nakamura <upa@haeena.net>2023-05-07 21:05:05 +0900
commit24e86f58d87d48864e6ae33f1953124e467753ea (patch)
tree5bd65f8dd40209b6aaa08ca22c5224c059a22495 /src/path.h
parent1d3b3a2261153126832bab4276677cab6e262ed2 (diff)
mscp: maintain mscp_thread structs in list
Instead of m->threads array, struct mscp_thread instanes are maintained in m->thread_list. This enables stable counter access via mscp_get_stats().
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/path.h b/src/path.h
index 8c912d8..c397a08 100644
--- a/src/path.h
+++ b/src/path.h
@@ -201,11 +201,16 @@ static int mscp_stat(const char *path, mstat *s, sftp_session sftp)
if (sftp) {
s->r = sftp_stat(sftp, path);
- if (!s->r)
+ if (!s->r) {
+ mscp_set_error("sftp_stat: %s %s",
+ sftp_get_ssh_error(sftp), path);
return -1;
+ }
} else {
- if (stat(path, &s->l) < 0)
+ if (stat(path, &s->l) < 0) {
+ mscp_set_error("stat: %s %s", strerrno(), path);
return -1;
+ }
}
return 0;