aboutgitcodelistschat:MatrixIRC
path: root/eater
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-05-17 13:20:13 +0200
committerAlice Frosi <afrosi@redhat.com>2023-05-17 13:20:13 +0200
commit1e78526693d22abe24c98291a782998573f6b01d (patch)
tree9ee8bf1a813e73d63962357fdd2318bd390d3bc0 /eater
parent504d9e38a528ca8bf6f658223a1935e9bc537d8a (diff)
downloadseitan-1e78526693d22abe24c98291a782998573f6b01d.tar
seitan-1e78526693d22abe24c98291a782998573f6b01d.tar.gz
seitan-1e78526693d22abe24c98291a782998573f6b01d.tar.bz2
seitan-1e78526693d22abe24c98291a782998573f6b01d.tar.lz
seitan-1e78526693d22abe24c98291a782998573f6b01d.tar.xz
seitan-1e78526693d22abe24c98291a782998573f6b01d.tar.zst
seitan-1e78526693d22abe24c98291a782998573f6b01d.zip
Minor fixes for the filter and the eater
Add: - ignore_args field for the filter. - use MAX_FILTER to define the filter size in the eater
Diffstat (limited to 'eater')
-rw-r--r--eater/Makefile5
-rw-r--r--eater/eater.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/eater/Makefile b/eater/Makefile
index 2e08b1f..1f85126 100644
--- a/eater/Makefile
+++ b/eater/Makefile
@@ -8,10 +8,11 @@
# Author: Alice Frosi <afrosi@redhat.com>
COMMON_DIR :=../common
+COOKER_DIR := ../cooker
SRCS := $(COMMON_DIR)/common.c eater.c
-HEADERS := $(COMMON_DIR)/common.h
+HEADERS := $(COMMON_DIR)/common.h $(COOKER_DIR)/filter.h
BIN := $(OUTDIR)/seitan-eater
-CFLAGS += -Wall -Wextra -pedantic -I$(COMMON_DIR)
+CFLAGS += -Wall -Wextra -pedantic -I$(COMMON_DIR) -I$(COOKER_DIR)
eater: $(SRCS) $(HEADERS)
$(CC) $(CFLAGS) -o $(BIN) $(SRCS)
diff --git a/eater/eater.c b/eater/eater.c
index 0236637..2169eb6 100644
--- a/eater/eater.c
+++ b/eater/eater.c
@@ -23,6 +23,8 @@
#include <sys/stat.h>
#include "common.h"
+#include "filter.h"
+
static struct option options[] = {
{ "input", required_argument, NULL, 'i' },
{ 0, 0, 0, 0 },
@@ -85,7 +87,7 @@ static void signal_handler(__attribute__((unused)) int s)
*/
int main(int argc, char **argv)
{
- struct sock_filter filter[1024];
+ struct sock_filter filter[MAX_FILTER];
struct arguments arguments;
struct sigaction act;
int fd, flags;