Skip to content
Permalink
Browse files

fix aio_init() symbol conflict by renaming to aio_global_init()

  • Loading branch information...
jacobgorm committed Jan 15, 2019
1 parent b0ec292 commit 33cbcc978abfbe5adb45613633278645220d7b82
Showing with 8 additions and 18 deletions.
  1. +2 −5 aio.c
  2. +1 −2 aio.h
  3. +1 −2 img-fsck.c
  4. +1 −2 img-heat.c
  5. +1 −2 img-test.c
  6. +1 −2 kv.c
  7. +1 −3 nbd.c
7 aio.c
@@ -73,20 +73,17 @@ static void aio_init_curl(struct curl_state *cs) {
cs->max = -1;
}

void aio_init(void) {
void aio_global_init(void) {
for (int i = 0; i < sizeof(aios) / sizeof(aios[0]); ++i) {
AioEntry *e = &aios[i];
memset(e, 0, sizeof(*e));
e->fd = -1;
}
ioh_init();
curl_global_init(CURL_GLOBAL_DEFAULT);
aio_init_curl(&curl_global);
}

void aio_close(void) {
//curl_multi_cleanup(cmh);
}

void aio_add_wait_object(int fd, void (*cb) (void *opaque), void *opaque) {
for (int i = 0; i < sizeof(aios) / sizeof(aios[0]); ++i) {
AioEntry *e = &aios[i];
3 aio.h
@@ -4,8 +4,7 @@
struct ioh_event;
struct CURL;

void aio_init(void);
void aio_close(void);
void aio_global_init(void);
int aio_add_curl_handle(struct CURL *ch);
void aio_add_wait_object(int fd, void (*cb) (void *opaque), void *opaque);
void aio_wait(void);
@@ -33,8 +33,7 @@ int main(int argc, char **argv)
exit(-1);
}

ioh_init();
aio_init();
aio_global_init();

const char *dst = argv[1];
int r;
@@ -66,8 +66,7 @@ int main(int argc, char **argv)
exit(-1);
}

ioh_init();
aio_init();
aio_global_init();

const char *dst = argv[1];
const char *trace = argv[2];
@@ -174,8 +174,7 @@ int main(int argc, char **argv)
exit(-1);
}

ioh_init();
aio_init();
aio_global_init();

const char *dst = argv[1];

3 kv.c
@@ -49,8 +49,7 @@ static void *kv_aio_thread(void *bs)
}

int kv_global_init(void) {
ioh_init();
aio_init();
aio_global_init();
pthread_t tid;
pthread_create(&tid, NULL, kv_aio_thread, NULL);
return 0;
4 nbd.c
@@ -292,8 +292,7 @@ int main(int argc, char **argv)
}

printf("opening swapimage %s...\n", fn);
ioh_init();
aio_init();
aio_global_init();

int needs_format = 0;
if (!file_exists(fn)) {
@@ -430,6 +429,5 @@ int main(int argc, char **argv)
swap_flush(&bs);
dump_swapstat();
swap_close(&bs);
aio_close();
return 0;
}

0 comments on commit 33cbcc9

Please sign in to comment.
You can’t perform that action at this time.