Browse Source

Move <sys/socket.h> inclusion to fix build on DFlyBSD

The ``<sys/socket.h>`` header should be included in ``src/netutils.h``
before the usage of ``struct sockaddr_storage``, otherwise build failed
with errors such as:

```
In file included from udprelay.c:53:0:
netutils.h:68:22: error: 'struct sockaddr_storage' declared inside parameter list [-Werror]
                      int ipv6first);
                      ^
netutils.h:68:22: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
```

Tested on DragonFly BSD 4.9-development and Debian Linux testing.
pull/1519/head
Aaron LI 7 years ago
committed by Max Lv
parent
commit
e65b3b1505
2 changed files with 2 additions and 1 deletions
  1. 1
      src/netutils.c
  2. 2
      src/netutils.h

1
src/netutils.c

@ -29,7 +29,6 @@
#include "config.h"
#endif
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <unistd.h>

2
src/netutils.h

@ -23,6 +23,8 @@
#ifndef _NETUTILS_H
#define _NETUTILS_H
#include <sys/socket.h>
#if defined(__linux__)
#include <netdb.h>
#else

Loading…
Cancel
Save