diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-11 21:50:04 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-11 21:50:04 +0200 |
commit | d548547d99c5cd72fa205ac2ba6347e672185db7 (patch) | |
tree | 9060b9ad001b11866857c54491f4b6caf46cad81 /blaze822.c | |
parent | 6d98e06592f1adcb70a99a2d9fd604a1b81ec5ab (diff) | |
download | mblaze-d548547d99c5cd72fa205ac2ba6347e672185db7.tar.gz mblaze-d548547d99c5cd72fa205ac2ba6347e672185db7.tar.xz mblaze-d548547d99c5cd72fa205ac2ba6347e672185db7.zip |
add show
Diffstat (limited to 'blaze822.c')
-rw-r--r-- | blaze822.c | 16 |
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; +} |