argus-2.0.0V -- compile problems on FreeBSD

Borja Marcos borjam at sarenet.es
Wed Jan 31 09:39:07 EST 2001


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.



More information about the argus mailing list