X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsysdep.c;h=398eacadf61c052980951da8257e23e9a35a8cb6;hb=0a7e8462acb4861fe3fc2193319cec3552ea1c2f;hp=9755327ddf15e606035fe53eb7f3839b50dd78c5;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git- diff --git a/src/sysdep.c b/src/sysdep.c index 9755327..398eaca 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,11 +43,13 @@ 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" -#include #include /* ------------------------------- */ @@ -212,7 +215,9 @@ set_descriptor_non_blocking (int fd) } #endif +#ifdef F_SETFL fcntl (fd, F_SETFL, O_NONBLOCK); +#endif } #if defined (NO_SUBPROCESSES) @@ -1013,7 +1018,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); @@ -1902,7 +1907,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)) { @@ -2259,42 +2264,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 */