summaryrefslogtreecommitdiffstats
path: root/tests/test-socket-creation.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-04-21 08:35:20 (GMT)
committerThomas Graf <tgraf@redhat.com>2012-04-21 08:35:20 (GMT)
commite78975aea8dc6b091d56f5ac4c0bd6def598f070 (patch)
tree987b933a81e2119e11f8021c9cbb9de1c1521d4c /tests/test-socket-creation.c
parent9af54690041aaa0a4934c336709bdf42a57afe28 (diff)
downloadlibnl-e78975aea8dc6b091d56f5ac4c0bd6def598f070.zip
libnl-e78975aea8dc6b091d56f5ac4c0bd6def598f070.tar.gz
libnl-e78975aea8dc6b091d56f5ac4c0bd6def598f070.tar.bz2
tests: fix test programs to compile again
Diffstat (limited to 'tests/test-socket-creation.c')
-rw-r--r--tests/test-socket-creation.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/test-socket-creation.c b/tests/test-socket-creation.c
index a170ccd..83f3ad4 100644
--- a/tests/test-socket-creation.c
+++ b/tests/test-socket-creation.c
@@ -1,23 +1,24 @@
-#include "../src/utils.h"
+#include <netlink/netlink.h>
+#include <errno.h>
int main(int argc, char *argv[])
{
struct nl_sock *h[1025];
int i;
- h[0] = nl_handle_alloc();
+ h[0] = nl_socket_alloc();
printf("Created handle with port 0x%x\n",
nl_socket_get_local_port(h[0]));
- nl_handle_destroy(h[0]);
- h[0] = nl_handle_alloc();
+ nl_socket_free(h[0]);
+ h[0] = nl_socket_alloc();
printf("Created handle with port 0x%x\n",
nl_socket_get_local_port(h[0]));
- nl_handle_destroy(h[0]);
+ nl_socket_free(h[0]);
for (i = 0; i < 1025; i++) {
- h[i] = nl_handle_alloc();
+ h[i] = nl_socket_alloc();
if (h[i] == NULL)
- nl_perror("Unable to allocate socket");
+ nl_perror(ENOMEM, "Unable to allocate socket");
else
printf("Created handle with port 0x%x\n",
nl_socket_get_local_port(h[i]));