Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] Another OS/2 issue
Home

Re: [Freeciv-Dev] Another OS/2 issue

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "freeciv-dev@xxxxxxxxxxx" <freeciv-dev@xxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] Another OS/2 issue
From: "Alexander Mai" <st002279@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jul 1999 11:23:29 +0200 (CED)
Reply-to: "Alexander Mai" <st002279@xxxxxxxxxxxxxxxxxxxxxx>

On Mon, 26 Jul 1999 23:04:07 -0400, Greg Wooledge wrote:

>Alexander Mai (st002279@xxxxxxxxxxxxxxxxxxxxxx) wrote:
>
>> First an addition to the sys/select.h stuff:
>> 
>> given the configure patch one may adjust the lines in
>> sernet.c, civserver.c and mapview.c, too.
>> It seems to affect AIX, too. Another fine IBM product ;-)
>
>I've been running the civserver on AIX (4.3.2) without any problems.

No, I'm not indicating a bug; just a code snippet like

#if defined(AIX) || defined(__EMX__)
#include <sys/select.h>
#endif

exists (mutiple times) which would look much better with

#ifdef HAVE_SYS_SELECT_H


>> +#ifndef __EMX__
>>    if (!getuid() || !geteuid()) {
>>      fprintf(stderr, "%s: Fatal error: you're trying to run me as 
>> superuser!\n",
>>          (argv[0] ? argv[0] : "freeciv_server"));
>
>Embedding names of platforms and development environments is not the
>"Right Way" to do it -- it's what autoconf is designed to avoid.
>
>However, as I understand it, a lot of the compilers for single-user
>operating systems have getuid() and related calls for Unix compatibility,
>but these calls always return 0 (or some such behavior).  Thus, a simple
>autoconf check for getuid() will fail to detect that this platform's
>implementation is a merely a stub.
>
>(If you check that getuid() returns a non-zero value, then compilation
>of freeciv as root on a Unix-like box will give undesirable behavior
>in the resulting executable.  A lot of newbie Linux users compile/run
>everything as root, so ironically the exact scenario that the above code
>is trying to avoid would be aggravated.)
>
>Does anyone know of a good way to determine (at ./configure time) whether
>one is on a multi-user or single-user operating system?

You're guessing right, and therefore every clever way to detect
the kind of system is likely to fail, since you never know what
the relevant calls return on a single-user system ...

So one might have to use a list of system which do support,
like 
   #if defined(unix) || defined(whatever)
and hope the "whatever" is only a small number of systems ?!


------------------------------------------------------------------
  Alexander Mai
  st002279@xxxxxxxxxxxxxxxxxxxxxx
------------------------------------------------------------------



[Prev in Thread] Current Thread [Next in Thread]