CYGWIN: fix build.

Signed-off-by: Carlo Bramini <carlo_bramini@users.sourceforge.net>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit e298600303)
This commit is contained in:
Carlo Bramini
2024-08-16 08:58:28 +00:00
committed by Jakub Jelen
parent 8d0d3d4d7b
commit c85dc05436
2 changed files with 4 additions and 2 deletions

View File

@@ -1971,7 +1971,7 @@ char *ssh_strreplace(const char *src, const char *pattern, const char *replace)
*/
char *ssh_strerror(int err_num, char *buf, size_t buflen)
{
#if defined(__linux__) && defined(__GLIBC__) && defined(_GNU_SOURCE)
#if ((defined(__linux__) && defined(__GLIBC__)) || defined(__CYGWIN__)) && defined(_GNU_SOURCE)
/* GNU extension on Linux */
return strerror_r(err_num, buf, buflen);
#else
@@ -1989,7 +1989,7 @@ char *ssh_strerror(int err_num, char *buf, size_t buflen)
buf[0] = '\0';
}
return buf;
#endif /* defined(__linux__) && defined(__GLIBC__) && defined(_GNU_SOURCE) */
#endif /* ((defined(__linux__) && defined(__GLIBC__)) || defined(__CYGWIN__)) && defined(_GNU_SOURCE) */
}
/**

View File

@@ -264,7 +264,9 @@ encode_termios_opts(struct termios *attr, unsigned char *buf, size_t buflen)
SSH_ENCODE_LOCAL_OPT(IEXTEN)
SSH_ENCODE_LOCAL_OPT(ECHOCTL)
SSH_ENCODE_LOCAL_OPT(ECHOKE)
#ifdef PENDIN
SSH_ENCODE_LOCAL_OPT(PENDIN)
#endif
#undef SSH_ENCODE_LOCAL_OPT
#define SSH_ENCODE_CC_OPT(opt) SSH_ENCODE_OPT(TTY_OP_##opt, attr->c_cc[opt])