argus-2.0.0V -- compile problems on FreeBSD

Carter Bullard carter at qosient.com
Wed Jan 31 10:04:22 EST 2001


Well, no wonder this doesn't work.

The assignment should be for FreeBSD:

#if defined(FreeBSD)
   *stdout = *FILE;
   *stderr = *FILE;
#else
   stdout = FILE;
   stderr = FILE;
#endif

does this work for anyone?

Carter

Carter Bullard
QoSient, LLC
300 E. 56th Street, Suite 18K
New York, New York  10022

carter at qosient.com
Phone +1 212 813-9426
Fax   +1 212 813-9426




-----Original Message-----
From: owner-argus at lists.andrew.cmu.edu
[mailto:owner-argus at lists.andrew.cmu.edu]On Behalf Of Borja Marcos
Sent: Wednesday, January 31, 2001 9:39 AM
To: argus at lists.andrew.cmu.edu
Subject: Re: argus-2.0.0V -- compile problems on FreeBSD


Russell Fulton wrote:
> 
> I have compile problems on FreeBSD:
> 
> gcc -pthread -O -I . -I../include  -I../include/linux-include
> -DHAVE_SYS_IOCCOM_H=1 -DHAVE_SYS_SOCKIO_H=1 -DHAVE_ETHER_HOSTTON=1
> -DHAVE_STRERROR=1 -DHAVE_SOCKADDR_SA_LEN=1 -c ./argus.c
> ./argus.c: In function `main':
> ./argus.c:382: invalid lvalue in assignment
> ./argus.c:383: invalid lvalue in assignment
> *** Error code 1
> 
>       if ((tmpfile = fopen ("/dev/null", "w")) != NULL) {
>          fclose(stdout);
>          fclose(stderr);
> =>         stdout = tmpfile;
> =>         stderr = tmpfile;
>       } else
>          ArgusLog (LOG_ERR, "Cannot map stdout to /dev/null\n");
> 
> It would appear that freebsd does not like reassigning to stderr and
> stdout ???

	That's right. Look at the definitions for stdin and stdout in
/usr/include/stdio.h:

#define stdin   (&__sF[0])
#define stdout  (&__sF[1])
#define stderr  (&__sF[2])

	And the array __sF[] is:

	
__BEGIN_DECLS
extern FILE __sF[];
__END_DECLS



	Borja.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2876 bytes
Desc: not available
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20010131/3407c370/attachment.bin>


More information about the argus mailing list