[pisa-src] Re: r2158 - in trunk: Makefile.am libpisa/sysdep.c libpisa/sysdep.h libpisa/sysdep_tun.c

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Wed, 17 Mar 2010 19:30:49 +0100

On Wed, Mar 17, 2010 at 07:19:50PM +0100, Mircea Gherzan wrote:
> 
> Log:
> Move the clock_gettime emulation to the header, making it inline for
> performance reasons.
> Because of this, the sysdep.c file only contains tunneling emulation,
> so rename it to sysdep_tun.c
> 
> Added:
>    trunk/libpisa/sysdep_tun.c
> Deleted:
>    trunk/libpisa/sysdep.c

This should be done with 'svn cp' instead so as to preserve history.

> --- trunk/Makefile.am Wed Mar 17 19:08:56 2010        (r2157)
> +++ trunk/Makefile.am Wed Mar 17 19:19:50 2010        (r2158)
> @@ -80,7 +80,7 @@
>                                libpisa/scheduler.c   \
>                                libpisa/tunnel.c      \
>                                libpisa/util.c        \
> -                           libpisa/sysdep.c
> +                           libpisa/sysdep_tun.c

stray tabs

> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ trunk/libpisa/sysdep_tun.c        Wed Mar 17 19:19:50 2010        (r2158)
> @@ -0,0 +1,55 @@
> +
> +#ifdef __linux
> +# define _BSD_SOURCE    /* required for the ifreq structure */
> +#endif

The #ifdef is redundant and wrong, __linux (or was it __linux__) is about
the kernel, but _BSD_SOURCE triggers definitions in libc...

> +#include <fcntl.h>
> +#include <stdlib.h>
> +#include <errno.h>
> +#include <sys/time.h>       /* gettimeofday */
> +#include <sys/ioctl.h>
> +#include <net/if.h>
> +
> +#include "config.h"
> +#include "global.h"
> +#include "sysdep.h"
> +#include "util.h"

I doubt you really need all these headers, but sys/types.h is needed for
size_t..

> +#ifdef __linux__
> +
> +#endif

ugly :)

Diego

Other related posts: