All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH][TOOLS] xenstore: NetBSD fix plus minor cleanup
Date: Mon, 22 Oct 2007 14:30:43 +0200	[thread overview]
Message-ID: <200710221430.43956.Christoph.Egger@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]


Hi!

xs_domain_dev: return file used on NetBSD
xs_daemon_path, xs_daemon_socket_ro: Use sizeof() consequently.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

[-- Attachment #2: xenstore_xs.diff --]
[-- Type: text/plain, Size: 961 bytes --]

diff -r 7231d971f78c tools/xenstore/xs_lib.c
--- a/tools/xenstore/xs_lib.c	Sat Oct 20 09:30:00 2007 +0100
+++ b/tools/xenstore/xs_lib.c	Mon Oct 22 16:31:37 2007 +0200
@@ -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

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2007-10-22 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200710221430.43956.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.