Fixes to allow compilation on systems with glibc 2.1.92

This commit is contained in:
Pavel Roskin 2000-09-28 20:52:55 +00:00
parent 8d369e98a5
commit 43f3e6114c
4 changed files with 24 additions and 4 deletions

View File

@ -77,7 +77,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1 #define MODUTILS_MODULE_H 1
#ident "$Id: insmod.c,v 1.25 2000/09/25 21:45:58 andersen Exp $" #ident "$Id: insmod.c,v 1.26 2000/09/28 20:52:55 proski Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -283,7 +283,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1 #define MODUTILS_OBJ_H 1
#ident "$Id: insmod.c,v 1.25 2000/09/25 21:45:58 andersen Exp $" #ident "$Id: insmod.c,v 1.26 2000/09/28 20:52:55 proski Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -323,7 +323,12 @@ int delete_module(const char *);
/* this is the previous behavior, but it does result in /* this is the previous behavior, but it does result in
insmod.c being broken on anything except i386 */ insmod.c being broken on anything except i386 */
#ifndef EM_486
#define MATCH_MACHINE(x) (x == EM_386)
#else
#define MATCH_MACHINE(x) (x == EM_386 || x == EM_486) #define MATCH_MACHINE(x) (x == EM_386 || x == EM_486)
#endif
#define SHT_RELM SHT_REL #define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel #define Elf32_RelM Elf32_Rel

View File

@ -72,7 +72,12 @@ extern int update_main(int argc, char **argv)
/* Become a proper daemon */ /* Become a proper daemon */
setsid(); setsid();
chdir("/"); chdir("/");
#ifdef OPEN_MAX
for (pid = 0; pid < OPEN_MAX; pid++) close(pid); for (pid = 0; pid < OPEN_MAX; pid++) close(pid);
#else
/* glibc 2.1.92 requires using sysconf(_SC_OPEN_MAX) */
for (pid = 0; pid < sysconf(_SC_OPEN_MAX); pid++) close(pid);
#endif
/* /*
* This is no longer necessary since 1.3.5x, but it will harmlessly * This is no longer necessary since 1.3.5x, but it will harmlessly

View File

@ -77,7 +77,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1 #define MODUTILS_MODULE_H 1
#ident "$Id: insmod.c,v 1.25 2000/09/25 21:45:58 andersen Exp $" #ident "$Id: insmod.c,v 1.26 2000/09/28 20:52:55 proski Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -283,7 +283,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1 #define MODUTILS_OBJ_H 1
#ident "$Id: insmod.c,v 1.25 2000/09/25 21:45:58 andersen Exp $" #ident "$Id: insmod.c,v 1.26 2000/09/28 20:52:55 proski Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -323,7 +323,12 @@ int delete_module(const char *);
/* this is the previous behavior, but it does result in /* this is the previous behavior, but it does result in
insmod.c being broken on anything except i386 */ insmod.c being broken on anything except i386 */
#ifndef EM_486
#define MATCH_MACHINE(x) (x == EM_386)
#else
#define MATCH_MACHINE(x) (x == EM_386 || x == EM_486) #define MATCH_MACHINE(x) (x == EM_386 || x == EM_486)
#endif
#define SHT_RELM SHT_REL #define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel #define Elf32_RelM Elf32_Rel

View File

@ -72,7 +72,12 @@ extern int update_main(int argc, char **argv)
/* Become a proper daemon */ /* Become a proper daemon */
setsid(); setsid();
chdir("/"); chdir("/");
#ifdef OPEN_MAX
for (pid = 0; pid < OPEN_MAX; pid++) close(pid); for (pid = 0; pid < OPEN_MAX; pid++) close(pid);
#else
/* glibc 2.1.92 requires using sysconf(_SC_OPEN_MAX) */
for (pid = 0; pid < sysconf(_SC_OPEN_MAX); pid++) close(pid);
#endif
/* /*
* This is no longer necessary since 1.3.5x, but it will harmlessly * This is no longer necessary since 1.3.5x, but it will harmlessly