From: Chris Allegretta Date: Sat, 26 Jun 2004 00:12:19 +0000 (+0000) Subject: Tom Bates' port to the Tandem Nonstop kernel, tweaks by DLR X-Git-Tag: v1.2.4~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bceb202831b5e2b20da308575dca5c9a17c93149;p=nano.git 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 --- 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) {