~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to gnulib-tests/test-bind.c

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Test binding a server socket to a port.
2
 
   Copyright (C) 2011-2012 Free Software Foundation, Inc.
 
2
   Copyright (C) 2011-2013 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
24
24
#include <errno.h>
25
25
#include <netinet/in.h>
26
26
#include <arpa/inet.h>
 
27
#include <unistd.h>
27
28
 
28
29
#include "sockets.h"
29
30
#include "macros.h"
46
47
      ASSERT (errno == EBADF);
47
48
    }
48
49
    {
 
50
      close (99);
49
51
      errno = 0;
50
52
      ASSERT (bind (99, (const struct sockaddr *) &addr, sizeof (addr)) == -1);
51
53
      ASSERT (errno == EBADF);