+ Use setreu/gid if seteu/gid is not avaiable

+ Don't declare tzname extern for cygwin
This commit is contained in:
mainzelm 2002-01-09 11:25:02 +00:00
parent a8fa33646a
commit 06ce3e41e6
5 changed files with 32 additions and 3 deletions

View File

@ -48,6 +48,16 @@
#undef _XOPEN_SOURCE_EXTENDED
#undef CYGWIN
#undef HAVE_SETEGID
#undef HAVE_SETREGID
#undef HAVE_SETEUID
#undef HAVE_SETREUID
#undef socklen_t
#undef HAVE_HARRIS

View File

@ -311,6 +311,7 @@ AC_INIT(c/scheme48vm.c)
## NT - cygwin32
*-*-cygwin* )
AC_DEFINE(CYGWIN)
dir=cygwin32
EXEEXT=".exe"
;;
@ -352,6 +353,16 @@ esac
AC_CHECK_FUNCS(socket chroot)
AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR),
[LIBOBJS="$LIBOBJS c/fake/strerror.o"])
AC_CHECK_FUNC(seteuid, AC_DEFINE(HAVE_SETEUID),
AC_CHECK_FUNC(setreuid, AC_DEFINE(HAVE_SETREUID),
AC_MSG_ERROR("Neither setegid nor setregid defined. Cannot continue.")))
AC_CHECK_FUNC(setegid, AC_DEFINE(HAVE_SETEGID),
AC_CHECK_FUNC(setregid, AC_DEFINE(HAVE_SETREGID),
AC_MSG_ERROR("Neither setegid nor setregid defined. Cannot continue.")))
AC_MSG_CHECKING([n_name])
AC_TRY_LINK([#include <nlist.h>],
[struct nlist name_list;

View File

@ -1,5 +1,5 @@
/* OS-dependent support for what is supposed to be the standard ANSI C Library.
** Copyright (c) 1999 by Brian D. Carlstrom.
*/
struct netent *getnetbyaddr (long x, int y) {return NULL;}
struct netent *getnetbyname (const char *x) {return NULL;}
struct netent *getnetbyaddr (long x, int y) {return 0;}
struct netent *getnetbyname (const char *x) {return 0;}

View File

@ -622,7 +622,11 @@ s48_value scsh_setgid(s48_value gid)
s48_value scsh_setegid(s48_value gid)
{
#ifdef HAVE_SETEGID
int retval = setegid (s48_extract_integer (gid));
#else
int retval = setregid (-1, s48_extract_integer (gid));
#endif
if (retval == -1)
s48_raise_os_error_1(errno, gid);
return S48_UNSPECIFIC;
@ -680,7 +684,11 @@ s48_value scsh_setuid(s48_value uid)
s48_value scsh_seteuid(s48_value uid)
{
#ifdef HAVE_SETEUID
int retval = seteuid (s48_extract_integer (uid));
#else
int retval = setreuid (-1, s48_extract_integer (uid));
#endif
if (retval == -1)
s48_raise_os_error_1(errno, uid);
return S48_UNSPECIFIC;

View File

@ -53,7 +53,7 @@ extern char **environ;
/* To work in the UTC time zone, do "environ = utc_env;". */
static char *utc_env[] = {"TZ=UCT0", 0};
#ifdef HAVE_TZNAME
#if defined(HAVE_TZNAME) && !defined(CYGWIN)
extern char *tzname[]; /* Why isn't this defined in time.h? */
#endif