From bceb202831b5e2b20da308575dca5c9a17c93149 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sat, 26 Jun 2004 00:12:19 +0000 Subject: [PATCH] Tom Bates' port to the Tandem Nonstop kernel, tweaks by DLR git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_2_branch/nano@1820 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 +++++ nano.c | 4 ++-- nano.h | 14 +++++++++++--- rcfile.c | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b476c01..3ec9854a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ CVS code - is set, handler in main to run handle_sigwinch() when set. Should fix segfaults when nano is initially suspended while reading in a file (found by Mike Frysinger). + - Port to the Tandem NonStop Kernel (nsr-tandem-nsk). (Tom + Bates; minor tweaks by DLR) - nano.c: handle_sigwinch() - Rework so that nano properly redraws the screen on systems @@ -24,6 +26,9 @@ CVS code - #246956 (no warning when trying to open non-readable file). - Add an extra titlebar() call (useful when reading in a big file). +- nano.h: + - Move the NANO_H include guard up before the first #include. + (DLR) - configure.ac: - Remove the checks for resizeterm() and wresize(), as they're no longer needed. (DLR) diff --git a/nano.c b/nano.c index 7051938b..530500db 100644 --- a/nano.c +++ b/nano.c @@ -3099,7 +3099,7 @@ int main(int argc, char *argv[]) #if !defined(ENABLE_NANORC) && defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING) /* if we don't have rcfile support, we're root, and --disable-wrapping-as-root is used, turn wrapping off */ - if (geteuid() == 0) + if (geteuid() == NANO_ROOT_UID) SET(NO_WRAP); #endif @@ -3328,7 +3328,7 @@ int main(int argc, char *argv[]) flags |= flags_cpy; } #if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING) - else if (geteuid() == 0) + else if (geteuid() == NANO_ROOT_UID) SET(NO_WRAP); #endif #endif /* ENABLE_NANORC */ diff --git a/nano.h b/nano.h index b442503b..68c0b170 100644 --- a/nano.h +++ b/nano.h @@ -19,13 +19,21 @@ * * **************************************************************************/ +#ifndef NANO_H +#define NANO_H 1 + +#ifdef __TANDEM +/* Tandem NonStop Kernel */ +#include +#define NANO_ROOT_UID 65535 +#else +#define NANO_ROOT_UID 0 +#endif + #ifdef HAVE_LIMITS_H #include #endif -#ifndef NANO_H -#define NANO_H 1 - /* Macros for the flags int... */ #define SET(bit) flags |= bit #define UNSET(bit) flags &= ~bit diff --git a/rcfile.c b/rcfile.c index 8698db36..2657d2ef 100644 --- a/rcfile.c +++ b/rcfile.c @@ -663,7 +663,7 @@ void do_rcfile(void) #if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING) /* If we've already read $SYSCONFDIR/nanorc (if it's there), we're root, and --disable-wrapping-as-root is used, turn wrapping off */ - if (euid == 0) + if (euid == NANO_ROOT_UID) SET(NO_WRAP); #endif if ((rcstream = fopen(nanorc, "r")) == NULL) { -- 2.39.5