diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-08-12 15:46:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-08-12 15:46:55 (GMT) |
commit | 7ced9ccef7fae0b392858b1b7f44978e1e6df1cf (patch) | |
tree | a1188ca8eb48a541ee5922b3e8b096725da04ef4 /src/analysis/db | |
parent | fcc78751e1e733b8662fde7d5e8ac6023cb34582 (diff) |
Added a batch mode and a way to load binaries from command line.
Diffstat (limited to 'src/analysis/db')
-rw-r--r-- | src/analysis/db/server.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/analysis/db/server.c b/src/analysis/db/server.c index 0270201..6155b6d 100644 --- a/src/analysis/db/server.c +++ b/src/analysis/db/server.c @@ -497,7 +497,7 @@ static void *g_db_server_listener(GDbServer *server) if (ret != 1) continue; /* Le canal est fermé, une sortie doit être demandée... */ - if (fds.revents & POLLNVAL) + if (fds.revents & POLLHUP) break; if (fds.revents & (POLLIN | POLLPRI)) @@ -802,14 +802,21 @@ bool g_db_server_start(GDbServer *server) void g_db_server_stop(GDbServer *server) { - if (server->fd != -1) + int ret; /* Bilan d'un appel */ + + if (server->fd == -1) return; - close(server->fd); - server->fd = -1; + ret = shutdown(server->fd, SHUT_RDWR); + if (ret == -1) perror("shutdown"); g_thread_join(server->listener); + ret = close(server->fd); + if (ret == -1) perror("close"); + + server->fd = -1; + /* TODO : s'occuper des archives ouvertes */ } |