Fix compilation errors

This commit is contained in:
2024-04-09 14:34:06 +02:00
parent 14f33a7ef5
commit b8232cce15
5 changed files with 107 additions and 61 deletions
+11 -4
View File
@@ -1,6 +1,6 @@
#include <stdio.h>
#include <assert.h>
#include "io.h"
#include "io2.h"
#define MAX_RES 100
#define MAX_OPS 100
@@ -14,6 +14,12 @@ int main(void)
struct io_operation ops[MAX_OPS];
struct io_resource res[MAX_RES];
struct io_context ioc;
if (!io_global_init()) {
fprintf(stderr, "Couldn't perform the global initialization\n");
return -1;
}
if (!io_init(&ioc, res, ops, MAX_RES, MAX_OPS)) {
fprintf(stderr, "Couldn't initialize I/O context\n");
return -1;
@@ -24,7 +30,7 @@ int main(void)
fprintf(stderr, "Couldn't start listening\n");
return -1;
}
if (!io_accept(&ioc, socket, NULL)) {
if (!io_accept(&ioc, NULL, socket)) {
fprintf(stderr, "Couldn't start accept operation\n");
return -1;
}
@@ -40,12 +46,13 @@ int main(void)
io_close(&ioc, accepted);
if (!io_accept(&ioc, socket)) {
if (!io_accept(&ioc, NULL, socket)) {
fprintf(stderr, "Couldn't start accept operation\n");
return -1;
}
}
io_context_free(&ioc);
io_free(&ioc);
io_global_free();
return 0;
}