X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsysdep.c;h=0dc66fa3fce30aa46df5a2773739d099dd6208a4;hb=69560585d631f17bc636c6cf13fb7cf7d759dbd4;hp=a24221d7b40db8711db856ed7bbe03700a49ef7b;hpb=35adcaaeafb1fe93eaf00c39b48619e8f188ff3f;p=chise%2Fxemacs-chise.git.1 diff --git a/src/sysdep.c b/src/sysdep.c index a24221d..0dc66fa 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA. */ #ifdef WINDOWSNT #include +#ifndef __MINGW32__ /* should not conflict with "process.h", as per ANSI definition. This is not true though with visual c though. The trick below works with VC4.2b and with VC5.0. It assumes that VC is installed in a kind of @@ -42,6 +43,9 @@ Boston, MA 02111-1307, USA. */ which will conflict with the macro defined in lisp.h */ #include <../include/process.h> +#else +#include +#endif #endif /* WINDOWSNT */ #include "lisp.h" @@ -1015,7 +1019,7 @@ request_sigio_on_device (struct device *d) { int filedesc = DEVICE_INFD (d); -#if defined (I_SETSIG) && !defined(HPUX10) +#if defined (I_SETSIG) && !defined(HPUX10) && !defined(LINUX) { int events=0; ioctl (filedesc, I_GETSIG, &events); @@ -1904,7 +1908,7 @@ reset_one_device (struct device *d) else #endif if (DEVICE_STREAM_P (d)) - fflush (CONSOLE_STREAM_DATA (XCONSOLE (DEVICE_CONSOLE (d)))->outfd); + fflush (CONSOLE_STREAM_DATA (XCONSOLE (DEVICE_CONSOLE (d)))->out); #if defined(SIGIO) && !defined(BROKEN_SIGIO) if (!DEVICE_STREAM_P (d)) { @@ -2261,42 +2265,43 @@ init_system_name (void) # ifndef CANNOT_DUMP if (initialized) # endif /* not CANNOT_DUMP */ - { - struct hostent *hp = NULL; - int count; + if (!strchr (hostname, '.')) + { + struct hostent *hp = NULL; + int count; # ifdef TRY_AGAIN - for (count = 0; count < 10; count++) - { - h_errno = 0; + for (count = 0; count < 10; count++) + { + h_errno = 0; # endif - /* Some systems can't handle SIGALARM/SIGIO in gethostbyname(). */ - stop_interrupts (); - hp = gethostbyname (hostname); - start_interrupts (); + /* Some systems can't handle SIGALARM/SIGIO in gethostbyname(). */ + stop_interrupts (); + hp = gethostbyname (hostname); + start_interrupts (); # ifdef TRY_AGAIN - if (! (hp == 0 && h_errno == TRY_AGAIN)) - break; - Fsleep_for (make_int (1)); - } + if (! (hp == 0 && h_errno == TRY_AGAIN)) + break; + Fsleep_for (make_int (1)); + } # endif - if (hp) - { - CONST char *fqdn = (CONST char *) hp->h_name; - - if (!strchr (fqdn, '.')) - { - /* We still don't have a fully qualified domain name. - Try to find one in the list of alternate names */ - char **alias = hp->h_aliases; - while (*alias && !strchr (*alias, '.')) - alias++; - if (*alias) - fqdn = *alias; - } - hostname = (char *) alloca (strlen (fqdn) + 1); - strcpy (hostname, fqdn); - } - } + if (hp) + { + CONST char *fqdn = (CONST char *) hp->h_name; + + if (!strchr (fqdn, '.')) + { + /* We still don't have a fully qualified domain name. + Try to find one in the list of alternate names */ + char **alias = hp->h_aliases; + while (*alias && !strchr (*alias, '.')) + alias++; + if (*alias) + fqdn = *alias; + } + hostname = (char *) alloca (strlen (fqdn) + 1); + strcpy (hostname, fqdn); + } + } # endif /* HAVE_SOCKETS */ Vsystem_name = build_string (hostname); #endif /* HAVE_GETHOSTNAME */