rename + modifications pour que ça compile => tcpd cleaned
parent
fc44447e27
commit
f451e0f88d
|
@ -3,7 +3,7 @@ CFLAGS=-Wall -g
|
||||||
LDFLAGS= -pthread
|
LDFLAGS= -pthread
|
||||||
CFILES=$(wildcard *.c) # CFILES => recompiles everything on a C file change
|
CFILES=$(wildcard *.c) # CFILES => recompiles everything on a C file change
|
||||||
EXEC=$(basename $(wildcard *.c))
|
EXEC=$(basename $(wildcard *.c))
|
||||||
SOURCES=$(wildcard ../lib/communication.c ../lib/process.c)
|
SOURCES=$(wildcard ../../lib/communication.c ../../lib/process.c)
|
||||||
OBJECTS=$(SOURCES:.c=.o)
|
OBJECTS=$(SOURCES:.c=.o)
|
||||||
TESTS=$(addsuffix .test, $(EXEC))
|
TESTS=$(addsuffix .test, $(EXEC))
|
||||||
LCBOR=-lbor
|
LCBOR=-lbor
|
|
@ -1,4 +1,4 @@
|
||||||
#include "tcpdserver.h"
|
#include "tcpd.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
|
@ -6,7 +6,7 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include "../lib/communication.h"
|
#include "../../lib/communication.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct sockaddr_in c_addr;
|
struct sockaddr_in c_addr;
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../lib/communication.h"
|
#include "../../lib/communication.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
@ -9,12 +9,12 @@
|
||||||
do { perror(msg); exit(EXIT_FAILURE); } while (0)
|
do { perror(msg); exit(EXIT_FAILURE); } while (0)
|
||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
char *srv_message = malloc(1024);
|
char *srv_message = malloc(BUFSIZ);
|
||||||
char *pidfile = malloc(1024);
|
char *pidfile = malloc(BUFSIZ);
|
||||||
char *buffer = malloc(1024);
|
char *buffer = malloc(BUFSIZ);
|
||||||
|
|
||||||
snprintf(srv_message , 1024, "%s %d 1 1" ,"connect 127.0.0.1 6000" , getpid());
|
snprintf(srv_message, BUFSIZ, "%s %d 1 1", "connect 127.0.0.1 6000", getpid());
|
||||||
snprintf(pidfile, 1024,"%s%d-1-1", "/tmp/ipc/", getpid());
|
snprintf(pidfile, BUFSIZ, "%s%d-1-1", "/tmp/ipc/", getpid());
|
||||||
|
|
||||||
char *proc_message = "hello frero";
|
char *proc_message = "hello frero";
|
||||||
|
|
Reference in New Issue