Browse Source

* Removed some unneeded hacks from eggdev
* Possibly fixed the CPU TIME issue


svn: 719

Bryan Drewery 22 năm trước cách đây
mục cha
commit
d1fc56b980
6 tập tin đã thay đổi với 16 bổ sung94 xóa
  1. 1 1
      autotools/configure.ac
  2. 0 12
      autotools/includes/acinclude.m4
  3. 0 9
      config.h.in
  4. 1 21
      configure
  5. 0 4
      src/mod/modvals.h
  6. 14 47
      src/net.c

+ 1 - 1
autotools/configure.ac

@@ -123,7 +123,7 @@ AC_FUNC_STRFTIME
 
 #checkpoint
 AC_CACHE_SAVE
-AC_CHECK_FUNCS([clock fsync getdtablesize getrusage inet_aton isascii gethostbyname2])
+AC_CHECK_FUNCS([clock fsync getrusage inet_aton isascii gethostbyname2])
 AC_CHECK_FUNCS([getipnodebyname memcpy memset random rename setpgid sigaction sigemptyset snprintf srandom])
 #checkpoint
 AC_CACHE_SAVE

+ 0 - 12
autotools/includes/acinclude.m4

@@ -220,7 +220,6 @@ AC_DEFUN(EGG_CHECK_OS, [dnl
 LINUX=no
 IRIX=no
 SUNOS=no
-HPUX=no
 EGG_CYGWIN=no
 
 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
@@ -258,17 +257,6 @@ case "$egg_cv_var_system_type" in
     EGG_CYGWIN=yes
     AC_DEFINE(CYGWIN_HACKS, 1, [Define if running under cygwin])
   ;;
-  HP-UX)
-    HPUX=yes
-    AC_DEFINE(HPUX_HACKS, 1, [Define if running on hpux that supports dynamic linking])dnl
-    if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
-    then
-      AC_DEFINE(HPUX10_HACKS, 1, [Define if running on hpux 10.x])dnl
-    fi
-  ;;
-  dell)
-    AC_MSG_RESULT(Dell SVR4)
-  ;;
   IRIX)
     IRIX=yes
   ;;

+ 0 - 9
config.h.in

@@ -35,9 +35,6 @@
 /* Define to 1 if you have the `fsync' function. */
 #undef HAVE_FSYNC
 
-/* Define to 1 if you have the `getdtablesize' function. */
-#undef HAVE_GETDTABLESIZE
-
 /* Define to 1 if you have the `gethostbyname2' function. */
 #undef HAVE_GETHOSTBYNAME2
 
@@ -229,12 +226,6 @@
 /* Define to 1 if you have the <zlib.h> header file. */
 #undef HAVE_ZLIB_H
 
-/* Define if running on hpux 10.x */
-#undef HPUX10_HACKS
-
-/* Define if running on hpux that supports dynamic linking */
-#undef HPUX_HACKS
-
 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing
    slash. */
 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK

+ 1 - 21
configure

@@ -3552,7 +3552,6 @@ fi
 LINUX=no
 IRIX=no
 SUNOS=no
-HPUX=no
 EGG_CYGWIN=no
 
 echo "$as_me:$LINENO: checking system type" >&5
@@ -3736,24 +3735,6 @@ cat >>confdefs.h <<\_ACEOF
 #define CYGWIN_HACKS 1
 _ACEOF
 
-  ;;
-  HP-UX)
-    HPUX=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define HPUX_HACKS 1
-_ACEOF
-    if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define HPUX10_HACKS 1
-_ACEOF
-    fi
-  ;;
-  dell)
-    echo "$as_me:$LINENO: result: Dell SVR4" >&5
-echo "${ECHO_T}Dell SVR4" >&6
   ;;
   IRIX)
     IRIX=yes
@@ -10924,8 +10905,7 @@ rm -f confcache
 
 
 
-
-for ac_func in clock fsync getdtablesize getrusage inet_aton isascii gethostbyname2
+for ac_func in clock fsync getrusage inet_aton isascii gethostbyname2
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5

+ 0 - 4
src/mod/modvals.h

@@ -90,10 +90,6 @@
 #define COMPRESS_CFILE		  5
 #define COMPRESS_UFILE		  7
 
-#ifdef HPUX_HACKS
-#  include <dl.h>
-#endif
-
 typedef struct _module_entry {
   struct _module_entry	*next;
   char			*name;	/* Name of the module (without .so)	*/

+ 14 - 47
src/net.c

@@ -35,14 +35,6 @@
 #include <setjmp.h>
 #include "egg_timer.h"
 
-#if !HAVE_GETDTABLESIZE
-#  ifdef FD_SETSIZE
-#    define getdtablesize() FD_SETSIZE
-#  else
-#    define getdtablesize() 200
-#  endif
-#endif /* !HAVE_GETDTABLESIZE */
-
 extern struct dcc_t	*dcc;
 extern int		 backgrd, use_stderr, dcc_total;
 extern egg_traffic_t traffic;
@@ -1080,16 +1072,11 @@ int open_telnet_dcc(int sock, char *server, char *port)
 static int sockread(char *s, int *len)
 {
   fd_set fd;
-  int fds, i, x, fdtmp;
+  int fds = 0, i, x, fdtmp;
   struct timeval t;
   int grab = SGRAB;
   egg_timeval_t howlong;
 
-  fds = getdtablesize();
-#ifdef FD_SETSIZE
-  if (fds > FD_SETSIZE)
-    fds = FD_SETSIZE;		/* Fixes YET ANOTHER freebsd bug!!! */
-#endif /* FD_SETSIZE */
   if (timer_get_shortest(&howlong)) {
     /* No timer, default to 1 second. */
     t.tv_sec = 1;
@@ -1102,32 +1089,23 @@ static int sockread(char *s, int *len)
 
   FD_ZERO(&fd);
   
-  for (i = 0; i < MAXSOCKS; i++)
+  for (i = 0; i < MAXSOCKS; i++) {
     if (!(socklist[i].flags & (SOCK_UNUSED | SOCK_VIRTUAL))) {
       if ((socklist[i].sock == STDOUT) && !backgrd)
 	fdtmp = STDIN;
       else
 	fdtmp = socklist[i].sock;
-      /* 
-       * Looks like that having more than a call, in the same
-       * program, to the FD_SET macro, triggers a bug in gcc.
-       * SIGBUS crashing binaries used to be produced on a number
-       * (prolly all?) of 64 bits architectures.
-       * Make your best to avoid to make it happen again.
-       * 
-       * ITE
-       */
+
+      if (fdtmp > fds)
+        fds = fdtmp;
       FD_SET(fdtmp, &fd);
     }
-#ifdef HPUX_HACKS
-#ifndef HPUX10_HACKS
-  x = select(fds, (int *) &fd, (int *) NULL, (int *) NULL, &t);
-#else /* !HPUX10_HACKS */
-  x = select(fds, &fd, NULL, NULL, &t);
-#endif /* HPUX10_HACKS */
-#else /* !HPUX_HACKS */
+  }
+
+  fds++;
+
   x = select(fds, &fd, NULL, NULL, &t);
-#endif /* HPUX_HACKS */
+
   if (x > 0) {
     /* Something happened */
     for (i = 0; i < MAXSOCKS; i++) {
@@ -1642,37 +1620,26 @@ void dequeue_sockets()
 {
   int i, x;
 
-  int z = 0, fds;
+  int z = 0, fds = 0;
   fd_set wfds;
   struct timeval tv;
 
 /* ^-- start poptix test code, this should avoid writes to sockets not ready to be written to. */
-  fds = getdtablesize();
-
-#ifdef FD_SETSIZE
-  if (fds > FD_SETSIZE)
-    fds = FD_SETSIZE;           /* Fixes YET ANOTHER freebsd bug!!! */
-#endif /* FD_SETSIZE */
   FD_ZERO(&wfds);
   tv.tv_sec = 0;
   tv.tv_usec = 0; 		/* we only want to see if it's ready for writing, no need to actually wait.. */
   for (i = 0; i < MAXSOCKS; i++) { 
     if (!(socklist[i].flags & SOCK_UNUSED) && socklist[i].outbuf != NULL) {
       FD_SET(socklist[i].sock, &wfds);
+      if (socklist[i].sock > fds)
+        fds = socklist[i].sock;
       z = 1; 
     }
   }
   if (!z)
     return; 			/* nothing to write */
-#ifdef HPUX_HACKS
- #ifndef HPUX10_HACKS
-  select(fds, (int *) NULL, (int *) &wfds, (int *) NULL, &tv);
- #else /* !HPUX10_HACKS */
-  select(fds, NULL, &wfds, NULL, &tv);
- #endif /* HPUX10_HACKS */
-#else /* !HPUX_HACKS */
+  fds++;
   select(fds, NULL, &wfds, NULL, &tv);
-#endif /* HPUX_HACKS */
 
 /* end poptix */