From 9e9f31bf90304497c387e0089c0cb291d2327116 Mon Sep 17 00:00:00 2001 From: comatose Date: Fri, 7 Dec 2012 15:13:43 +0900 Subject: [PATCH] * buse.h: Added extern "C" keyword. --- buse.c | 3 ++- buse.h | 9 ++++++++- busexmp.c | 11 ----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/buse.c b/buse.c index bec09ea..2776bcf 100644 --- a/buse.c +++ b/buse.c @@ -66,7 +66,8 @@ int buse_main(int argc, char *argv[], const struct buse_operations *aop, void *u int sp[2]; int nbd, sk, err, tmp_fd; u_int64_t from; - u_int32_t len, bytes_read; + u_int32_t len; + ssize_t bytes_read; char *dev_file; struct nbd_request request; struct nbd_reply reply; diff --git a/buse.h b/buse.h index 943da9e..56dad64 100644 --- a/buse.h +++ b/buse.h @@ -1,8 +1,11 @@ #ifndef BUSE_H_INCLUDED #define BUSE_H_INCLUDED +#ifdef __cplusplus +extern "C" { +#endif + /* Most of this file was copied from nbd.h in the nbd distribution. */ - #include #include @@ -73,4 +76,8 @@ struct buse_operations { int buse_main(int argc, char *argv[], const struct buse_operations *bop, void *userdata); +#ifdef __cplusplus +} +#endif + #endif /* BUSE_H_INCLUDED */ diff --git a/busexmp.c b/busexmp.c index 76991c3..7a8db41 100644 --- a/busexmp.c +++ b/busexmp.c @@ -31,17 +31,6 @@ static int xmp_flush() return 0; } -static int xmp_trim(u_int64_t from, u_int32_t len) -{ - fprintf(stderr, "T %lu %u\n", from, len); - return 0; -} - -static int xmp_flush(){ - fprintf(stderr, "F\n"); - return 0; -} - static int xmp_trim(u_int64_t from, u_int32_t len){ fprintf(stderr, "T - %lu, %u\n", from, len); return 0;