diff options
author | Keir Fraser <keir@xensource.com> | 2007-10-22 14:22:39 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-10-22 14:22:39 +0100 |
commit | bdeaa9684d515dfad1ec969957b8e198cd4d162e (patch) | |
tree | f0dc82f81c7c398c30a5408ed2448fbcf3e94170 /tools/xenstore | |
parent | e38bd7ef8e10d417d5543b6436ca60fe59e44a7d (diff) | |
download | xen-bdeaa9684d515dfad1ec969957b8e198cd4d162e.tar.gz xen-bdeaa9684d515dfad1ec969957b8e198cd4d162e.tar.bz2 xen-bdeaa9684d515dfad1ec969957b8e198cd4d162e.zip |
A few small fixes for xenstored:
- Proper sizeof parameter to snprintf
- Return proper xs_domain_dev for netbsd.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/xenstore')
-rw-r--r-- | tools/xenstore/xs_lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c index 8375f15f0c..77cd64f3ca 100644 --- a/tools/xenstore/xs_lib.c +++ b/tools/xenstore/xs_lib.c @@ -44,7 +44,7 @@ static const char *xs_daemon_path(void) char *s = getenv("XENSTORED_PATH"); if (s) return s; - if (snprintf(buf, PATH_MAX, "%s/socket", + if (snprintf(buf, sizeof(buf), "%s/socket", xs_daemon_rundir()) >= PATH_MAX) return NULL; return buf; @@ -68,7 +68,7 @@ const char *xs_daemon_socket_ro(void) const char *s = xs_daemon_path(); if (s == NULL) return NULL; - if (snprintf(buf, PATH_MAX, "%s_ro", s) >= PATH_MAX) + if (snprintf(buf, sizeof(buf), "%s_ro", s) >= PATH_MAX) return NULL; return buf; } @@ -79,8 +79,10 @@ const char *xs_domain_dev(void) if (s) return s; -#ifdef __linux__ +#if defined(__linux__) return "/proc/xen/xenbus"; +#elif defined(__NetBSD__) + return "/kern/xen/xenbus"; #else return "/dev/xen/xenbus"; #endif |