diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2007-12-05 09:59:23 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2007-12-05 09:59:23 +0000 |
commit | 363a64884681a902b1c9303a7254a74fbbdd9936 (patch) | |
tree | 5548cd85442ae24852afa7de0b4d21cf95ce8270 /tools/blktap/lib | |
parent | 45be668f9f824725ea8258d581f14533be28ce11 (diff) | |
download | xen-363a64884681a902b1c9303a7254a74fbbdd9936.tar.gz xen-363a64884681a902b1c9303a7254a74fbbdd9936.tar.bz2 xen-363a64884681a902b1c9303a7254a74fbbdd9936.zip |
blktap: cleanups for *BSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/blktap/lib')
-rw-r--r-- | tools/blktap/lib/blktaplib.h | 1 | ||||
-rw-r--r-- | tools/blktap/lib/list.h | 4 | ||||
-rw-r--r-- | tools/blktap/lib/xs_api.c | 6 |
3 files changed, 8 insertions, 3 deletions
diff --git a/tools/blktap/lib/blktaplib.h b/tools/blktap/lib/blktaplib.h index 9d17c6152e..d31a7fac92 100644 --- a/tools/blktap/lib/blktaplib.h +++ b/tools/blktap/lib/blktaplib.h @@ -33,6 +33,7 @@ #define __BLKTAPLIB_H__ #include <xenctrl.h> +#include <sys/param.h> #include <sys/user.h> #include <xen/xen.h> #include <xen/io/blkif.h> diff --git a/tools/blktap/lib/list.h b/tools/blktap/lib/list.h index bda5f46a38..c82242f56f 100644 --- a/tools/blktap/lib/list.h +++ b/tools/blktap/lib/list.h @@ -8,6 +8,10 @@ #ifndef __LIST_H__ #define __LIST_H__ +#ifdef LIST_HEAD +#undef LIST_HEAD +#endif + #define LIST_POISON1 ((void *) 0x00100100) #define LIST_POISON2 ((void *) 0x00200200) diff --git a/tools/blktap/lib/xs_api.c b/tools/blktap/lib/xs_api.c index 41bbd47bb2..370a44aa4d 100644 --- a/tools/blktap/lib/xs_api.c +++ b/tools/blktap/lib/xs_api.c @@ -282,7 +282,7 @@ int register_xenbus_watch(struct xs_handle *h, struct xenbus_watch *watch) /* Pointer in ascii is the token. */ char token[sizeof(watch) * 2 + 1]; - sprintf(token, "%lX", (long)watch); + snprintf(token, sizeof(token), "%lX", (long)watch); if (find_watch(token)) { DPRINTF("watch collision!\n"); return -EINVAL; @@ -302,7 +302,7 @@ int unregister_xenbus_watch(struct xs_handle *h, struct xenbus_watch *watch) { char token[sizeof(watch) * 2 + 1]; - sprintf(token, "%lX", (long)watch); + snprintf(token, sizeof(token), "%lX", (long)watch); if (!find_watch(token)) { DPRINTF("no such watch!\n"); return -EINVAL; @@ -326,7 +326,7 @@ void reregister_xenbus_watches(struct xs_handle *h) char token[sizeof(watch) * 2 + 1]; list_for_each_entry(watch, &watches, list) { - sprintf(token, "%lX", (long)watch); + snprintf(token, sizeof(token), "%lX", (long)watch); xs_watch(h, watch->node, token); } } |