refactor error message-related functions

split message print fuctions (mpr_*), strerrno, and mscp_get/set_error
into print.c/h and strerrno.c/h.

ToDo: revise usages of priv_set_errv and pr_* functions.
This commit is contained in:
Ryo Nakamura
2024-02-06 21:54:04 +09:00
parent 76892a69f9
commit 4f0669f8f8
18 changed files with 268 additions and 292 deletions

View File

@@ -9,7 +9,7 @@
#include <fileops.h>
#include <ssh.h>
#include <message.h>
#include <print.h>
#include <platform.h>
@@ -63,7 +63,7 @@ static void sftp_err_to_errno(sftp_session sftp)
errno = ENODEV;
break;
default:
mpr_warn("unkown SSH_FX response %d", sftperr);
pr_warn("unkown SSH_FX response %d", sftperr);
}
}
@@ -199,7 +199,7 @@ static void sftp_attr_to_stat(sftp_attributes attr, struct stat *st)
st->st_mode |= S_IFIFO; /* really? */
break;
default:
mpr_warn("unkown SSH_FILEXFER_TYPE %d", attr->type);
pr_warn("unkown SSH_FILEXFER_TYPE %d", attr->type);
}
}