about summary refs log tree commit diff
path: root/blaze822.c
diff options
context:
space:
mode:
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/blaze822.c b/blaze822.c
index f55c00d..3df50a8 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -376,3 +376,19 @@ blaze822_loop(int argc, char *argv[], void (*cb)(char *))
 
 	return i;
 }
+
+int
+blaze822_body(struct message *mesg, char *file)
+{
+	int fd = open(file, O_RDONLY);
+	if (fd < 0)
+		return fd;
+
+	if (lseek(fd, mesg->end - mesg->msg, SEEK_SET) < 0) {
+		perror("lseek");
+		close(fd);
+		return -1;
+	}
+
+	return fd;
+}