summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-02-26 23:18:39 +0900
committerRyo Nakamura <upa@haeena.net>2023-02-26 23:18:39 +0900
commit700d64b375470de42589ea66baabeee289cb66f2 (patch)
treed0f39cd366521dc8c98ee2f97d80566de8746d1e /src/path.h
parent2bad21bdc296c26d52e97359f1c1ce2e9b96f1aa (diff)
now mscp links libmscp
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/path.h b/src/path.h
index 1fa2ebf..2672f51 100644
--- a/src/path.h
+++ b/src/path.h
@@ -98,14 +98,15 @@ static mdir *mscp_opendir(const char *path, sftp_session sftp)
if (sftp) {
d->r = sftp_opendir(sftp, path);
if (!d->r) {
- pr_err("sftp_opendir: %s: %s\n", path, sftp_get_ssh_error(sftp));
+ pr_err("sftp_opendir '%s': %s\n",
+ path, sftp_get_ssh_error(sftp));
free(d);
return NULL;
}
} else {
d->l = opendir(path);
if (!d->l) {
- pr_err("opendir: %s: %s\n", path, strerrno());
+ pr_err("opendir '%s': %s\n", path, strerrno());
free(d);
return NULL;
}
@@ -227,7 +228,7 @@ struct mscp_file_handle {
};
typedef struct mscp_file_handle mfh;
-static mfh mscp_open(const char *path, mode_t mode, int flags, size_t off,
+static mfh mscp_open(const char *path, int flags, mode_t mode, size_t off,
sftp_session sftp)
{
mfh h;
@@ -238,12 +239,12 @@ static mfh mscp_open(const char *path, mode_t mode, int flags, size_t off,
if (sftp) {
h.sf = sftp_open(sftp, path, flags, mode);
if (!h.sf) {
- pr_err("sftp_open %s: %s\n", path, sftp_get_ssh_error(sftp));
+ pr_err("sftp_open '%s': %s\n", path, sftp_get_ssh_error(sftp));
return h;
}
if (sftp_seek64(h.sf, off) < 0) {
- pr_err("sftp_seek64 %s: %s\n", path, sftp_get_ssh_error(sftp));
+ pr_err("sftp_seek64 '%s': %s\n", path, sftp_get_ssh_error(sftp));
sftp_close(h.sf);
h.sf = NULL;
return h;
@@ -251,11 +252,11 @@ static mfh mscp_open(const char *path, mode_t mode, int flags, size_t off,
} else {
h.fd = open(path, flags, mode);
if (h.fd < 0) {
- pr_err("open %s: %s\n", path, strerrno());
+ pr_err("open '%s': %s\n", path, strerrno());
return h;
}
if (lseek(h.fd, off, SEEK_SET) < 0) {
- pr_err("lseek %s: %s\n", path, strerrno());
+ pr_err("lseek '%s': %s\n", path, strerrno());
close(h.fd);
h.fd = -1;
return h;
@@ -283,12 +284,12 @@ static int mscp_chmod(const char *path, mode_t mode, sftp_session sftp)
{
if (sftp) {
if (sftp_chmod(sftp, path, mode) < 0) {
- pr_err("sftp_chmod %s: %s\n", path, sftp_get_ssh_error(sftp));
+ pr_err("sftp_chmod '%s': %s\n", path, sftp_get_ssh_error(sftp));
return -1;
}
} else {
if (chmod(path, mode) < 0) {
- pr_err("chmod %s: %s\n", path, strerrno());
+ pr_err("chmod '%s': %s\n", path, strerrno());
return -1;
}
}