Browse Source

ntk: Clean up console spawning

* Fix a few incorrect header dependencies
Alexander von Gluck IV 10 years ago
parent
commit
cf9063f92b
6 changed files with 24 additions and 10 deletions
  1. 2
    1
      src/SConscript
  2. 1
    0
      src/gmap.h
  3. 1
    0
      src/map.h
  4. 5
    7
      src/netsukuku.c
  5. 7
    2
      src/ntk-console-server.c
  6. 8
    0
      src/ntk-console-server.h

+ 2
- 1
src/SConscript View File

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

+ 1
- 0
src/gmap.h View File

@@ -19,6 +19,7 @@
19 19
 #ifndef GMAP_H
20 20
 #define GMAP_H
21 21
 
22
+#include "includes.h"
22 23
 #include "llist.c"
23 24
 #include "map.h"
24 25
 

+ 1
- 0
src/map.h View File

@@ -19,6 +19,7 @@
19 19
 #ifndef MAP_H
20 20
 #define MAP_H
21 21
 
22
+#include "includes.h"
22 23
 #include "inet.h"
23 24
 
24 25
 /* Generic map defines */

+ 5
- 7
src/netsukuku.c View File

@@ -40,7 +40,7 @@
40 40
 #include "radar.h"
41 41
 #include "hook.h"
42 42
 #include "rehook.h"
43
-#include "ntk-console-bindings.c"
43
+#include "ntk-console-server.h"
44 44
 #include <pthread.h>
45 45
 
46 46
 
@@ -420,16 +420,14 @@ check_excluded();
420 420
 freeifaddrs(addrs);
421 421
 }
422 422
 
423
-void *console_recv_send1(void *void_ptr){
424
-    console_recv_send();
425
-}
426 423
 
427
-int ntk_thread_creatation(void) {
424
+void
425
+ntk_thread_creatation(void) {
428 426
     int x;
429 427
     pthread_t console_recv_send_thread;
430
-    if(pthread_create(&console_recv_send_thread, NULL, console_recv_send1, &x)) {
428
+    if(pthread_create(&console_recv_send_thread, NULL, &console_recv_send, &x)) {
431 429
         fprintf(stderr, "Error creating thread\n");
432
-        return -1;
430
+        exit(-1);
433 431
     }
434 432
 }
435 433
 

src/ntk-console-bindings.c → src/ntk-console-server.c View File

@@ -3,6 +3,7 @@
3 3
 
4 4
 
5 5
 #include <utmp.h>
6
+#include <stdio.h>
6 7
 #include <sys/un.h>
7 8
 #include <unistd.h>
8 9
 
@@ -203,9 +204,13 @@ wait_session(int server_fd)
203 204
 }
204 205
 
205 206
 
206
-void
207
-console_recv_send(void)
207
+void*
208
+console_recv_send(void *arg)
208 209
 {
210
+	char* uargv;
211
+
209 212
 	opensocket();
210 213
 	wait_session(serverfd);
214
+
215
+	return uargv;
211 216
 }

+ 8
- 0
src/ntk-console-server.h View File

@@ -0,0 +1,8 @@
1
+#ifndef NTKCONSOLESERVER_H
2
+#define NTKCONSOLESERVER_H
3
+
4
+
5
+void* console_recv_send(void *arg);
6
+
7
+
8
+#endif /* NTKCONSOLESERVER_H */

Loading…
Cancel
Save