ntk: Clean up console spawning

* Fix a few incorrect header dependencies
This commit is contained in:
Alexander von Gluck IV 2014-09-14 12:12:48 -05:00
parent c92713f4d5
commit cf9063f92b
6 changed files with 24 additions and 10 deletions

View File

@ -35,7 +35,8 @@ sources_netsukuku = Split("""accept.c llist.c ipv6-gmp.c inet.c request.c map.c
dnslib.c andns.c andns_net.c andns_snsd.c
ll_map.c libnetlink.c if.c krnl_route.c krnl_rule.c
iptunnel.c route.c conf.c dns_wrapper.c igs.c mark.c
libiptc/libip4tc.c libping.c netsukuku.c""") + sources_common
libiptc/libip4tc.c libping.c ntk-console-server.c
netsukuku.c""") + sources_common
sources_ntkresolv = sources_common + Split("""andns_lib.c ntkresolv.c andns_net.c
crypto.c snsd_cache.c inet.c
ll_map.c libnetlink.c

View File

@ -19,6 +19,7 @@
#ifndef GMAP_H
#define GMAP_H
#include "includes.h"
#include "llist.c"
#include "map.h"

View File

@ -19,6 +19,7 @@
#ifndef MAP_H
#define MAP_H
#include "includes.h"
#include "inet.h"
/* Generic map defines */

View File

@ -40,7 +40,7 @@
#include "radar.h"
#include "hook.h"
#include "rehook.h"
#include "ntk-console-bindings.c"
#include "ntk-console-server.h"
#include <pthread.h>
@ -420,16 +420,14 @@ check_excluded();
freeifaddrs(addrs);
}
void *console_recv_send1(void *void_ptr){
console_recv_send();
}
int ntk_thread_creatation(void) {
void
ntk_thread_creatation(void) {
int x;
pthread_t console_recv_send_thread;
if(pthread_create(&console_recv_send_thread, NULL, console_recv_send1, &x)) {
if(pthread_create(&console_recv_send_thread, NULL, &console_recv_send, &x)) {
fprintf(stderr, "Error creating thread\n");
return -1;
exit(-1);
}
}

View File

@ -3,6 +3,7 @@
#include <utmp.h>
#include <stdio.h>
#include <sys/un.h>
#include <unistd.h>
@ -203,9 +204,13 @@ wait_session(int server_fd)
}
void
console_recv_send(void)
void*
console_recv_send(void *arg)
{
char* uargv;
opensocket();
wait_session(serverfd);
return uargv;
}

8
src/ntk-console-server.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef NTKCONSOLESERVER_H
#define NTKCONSOLESERVER_H
void* console_recv_send(void *arg);
#endif /* NTKCONSOLESERVER_H */