summary refs log tree commit diff
path: root/blaze822.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-11 21:50:04 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-11 21:50:04 +0200
commitd548547d99c5cd72fa205ac2ba6347e672185db7 (patch)
tree9060b9ad001b11866857c54491f4b6caf46cad81 /blaze822.c
parent6d98e06592f1adcb70a99a2d9fd604a1b81ec5ab (diff)
downloadmblaze-d548547d99c5cd72fa205ac2ba6347e672185db7.tar.gz
mblaze-d548547d99c5cd72fa205ac2ba6347e672185db7.tar.xz
mblaze-d548547d99c5cd72fa205ac2ba6347e672185db7.zip
add show
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;
+}