Skip to content
Snippets Groups Projects
Commit ebacc98f authored by Georges Da Costa's avatar Georges Da Costa
Browse files

cleanup with valgrind

parent 23717da5
No related branches found
No related tags found
No related merge requests found
...@@ -10,21 +10,21 @@ mojitos_group: $(OBJECTS_GRP) counters_option.h ...@@ -10,21 +10,21 @@ mojitos_group: $(OBJECTS_GRP) counters_option.h
gcc $(DEBUG) -O3 -Wall -o mojitos_group $(OBJECTS_GRP) -lpowercap gcc $(DEBUG) -O3 -Wall -o mojitos_group $(OBJECTS_GRP) -lpowercap
counters_%.o: counters_%.c counters.h counters_%.o: counters_%.c counters.h
gcc -c -O3 -Wall $< -o $@ gcc $(DEBUG) -c -O3 -Wall $< -o $@
counters_option.h: counters_option.py counters_option.h: counters_option.py
./counters_option.py > counters_option.h ./counters_option.py > counters_option.h
mojitos.o: mojitos.c counters_option.h mojitos.o: mojitos.c counters_option.h
gcc -c -O3 -Wall $< -o $@ gcc $(DEBUG) -c -O3 -Wall $< -o $@
debug: DEBUG = -DDEBUG debug: DEBUG = -DDEBUG -g
debug: all debug: all
%.o : %.c %.h %.o : %.c %.h
gcc -c -O3 -Wall $< -o $@ gcc $(DEBUG) -c -O3 -Wall $< -o $@
clean: clean:
\rm -f *~ *.o mojitos_group mojitos counters_option.h \rm -f *~ *.o mojitos_group mojitos counters_option.h
...@@ -34,6 +34,7 @@ char **init_network(char* dev) { ...@@ -34,6 +34,7 @@ char **init_network(char* dev) {
char *end_of_dev = index(buffer, '\t'); char *end_of_dev = index(buffer, '\t');
*end_of_dev='\0'; *end_of_dev='\0';
dev = buffer; dev = buffer;
fclose(f);
} }
char *filenames[] = {"/sys/class/net/%s/statistics/rx_packets", char *filenames[] = {"/sys/class/net/%s/statistics/rx_packets",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment