Skip to content

Commit

Permalink
Get the example socket includes right.
Browse files Browse the repository at this point in the history
Signed-off-by: Angus Salkeld <[email protected]>
  • Loading branch information
asalkeld committed Apr 3, 2012
1 parent 7a09cda commit ce1da1f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ AC_CHECK_HEADERS([arpa/inet.h link.h fcntl.h inttypes.h limits.h netinet/in.h st
dlfcn.h time.h sys/time.h stdlib.h string.h strings.h sys/types.h sys/stat.h \
sys/param.h sys/socket.h sys/time.h sys/poll.h sys/epoll.h sys/uio.h sys/event.h \
sys/sockio.h sys/un.h sys/resource.h syslog.h errno.h unistd.h sys/mman.h \
sys/sem.h sys/ipc.h sys/msg.h mqueue.h])
sys/sem.h sys/ipc.h sys/msg.h mqueue.h netdb.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
Expand Down
11 changes: 10 additions & 1 deletion examples/tcpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@
*/
#include "os_base.h"

#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif /* HAVE_ARPA_INET_H */
#ifdef HAVE_NETDB_H
#include <netdb.h>

#endif /* HAVE_NETDB_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */

int
main(int argc, char *argv[])
Expand Down
16 changes: 14 additions & 2 deletions examples/tcpserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@
*/
#include "os_base.h"

#include <netdb.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#include <poll.h>
#endif /* HAVE_ARPA_INET_H */
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif /* HAVE_NETDB_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif /* HAVE_SYS_POLL_H */

#include <qb/qbdefs.h>
#include <qb/qbloop.h>
Expand Down

0 comments on commit ce1da1f

Please sign in to comment.