commit: f6a92e09192397cdb79735b6954b664259f19b27
parent: b76e3275817c85d1af8eff1433ef706b97659370
author: Brian Callahan <bcallah@openbsd.org>
date: Fri, 12 Jan 2018 23:27:51 -0500
NetBSD defines MAXLOGNAME different from all other BSDs.
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/portable.h b/portable.h
@@ -47,11 +47,13 @@
#endif /* !O_EXLOCK */
#ifndef _PW_NAME_LEN
-#ifdef __linux__
+#if defined(__linux__)
#define _PW_NAME_LEN LOGIN_NAME_MAX
+#elif defined(__NetBSD__)
+#define _PW_NAME_LEN MAXLOGNAME
#else
#define _PW_NAME_LEN MAXLOGNAME - 1
-#endif /* __linux__ */
+#endif /* __linux__ || __NetBSD__ */
#endif /* !_PW_NAME_LEN */
#ifndef RLIMIT_RSS
@@ -156,6 +158,10 @@ int strunvis(char *, const char *);
*/
#ifndef HAVE_SIGNAME
+#ifdef NSIG
+#undef NSIG
+#endif /* NSIG */
+#define NSIG 33
extern const char *const sys_signame[NSIG];
#endif /* !HAVE_SIGNAME */
@@ -811,6 +817,6 @@ struct { \
_Q_INVALIDATE((elm)->field.cqe_next); \
} while (0)
-#endif /* defined(__linux__) */
+#endif /* __linux__ */
#endif /* !_OKSH_PORTABLE_H_ */