From: Christoph Egger Subject: [PATCH][TOOLS] xenstore: cleanup Date: Tue, 15 Jul 2008 10:48:26 +0200 Message-ID: <200807151048.26849.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_aRGfInd5HUUkwPy" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_aRGfInd5HUUkwPy Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch makes xenstore functions static which have no prototype and removes unused talloc_open(). Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_aRGfInd5HUUkwPy Content-Type: text/x-diff; charset="us-ascii"; name="tools_xenstore.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tools_xenstore.diff" diff -r 750919688b61 tools/xenstore/talloc.c --- a/tools/xenstore/talloc.c Mon Jul 14 13:26:45 2008 +0100 +++ b/tools/xenstore/talloc.c Mon Jul 14 14:52:30 2008 +0200 @@ -500,7 +500,7 @@ void *talloc_init(const char *fmt, ...) should probably not be used in new code. It's in here to keep the talloc code consistent across Samba 3 and 4. */ -void talloc_free_children(void *ptr) +static void talloc_free_children(void *ptr) { struct talloc_chunk *tc; diff -r 750919688b61 tools/xenstore/tdb.c --- a/tools/xenstore/tdb.c Mon Jul 14 13:26:45 2008 +0100 +++ b/tools/xenstore/tdb.c Mon Jul 14 14:52:30 2008 +0200 @@ -28,7 +28,7 @@ #ifndef _SAMBA_BUILD_ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include #endif @@ -731,7 +731,7 @@ static int expand_file(TDB_CONTEXT *tdb, static int expand_file(TDB_CONTEXT *tdb, tdb_off size, tdb_off addition) { char buf[1024]; -#if HAVE_FTRUNCATE_EXTEND +#ifdef HAVE_FTRUNCATE_EXTEND if (ftruncate(tdb->fd, size+addition) != 0) { TDB_LOG((tdb, 0, "expand_file ftruncate to %d failed (%s)\n", size+addition, strerror(errno))); diff -r 750919688b61 tools/xenstore/xenstore_client.c --- a/tools/xenstore/xenstore_client.c Mon Jul 14 13:26:45 2008 +0100 +++ b/tools/xenstore/xenstore_client.c Mon Jul 14 14:52:30 2008 +0200 @@ -121,7 +121,7 @@ static int show_whole_path = 0; #define MIN(a, b) (((a) < (b))? (a) : (b)) -void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms) +static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms) { static struct expanding_buffer ebuf; char **e; diff -r 750919688b61 tools/xenstore/xenstored_core.c --- a/tools/xenstore/xenstored_core.c Mon Jul 14 13:26:45 2008 +0100 +++ b/tools/xenstore/xenstored_core.c Mon Jul 14 14:52:30 2008 +0200 @@ -347,23 +347,6 @@ static int destroy_fd(void *_fd) int *fd = _fd; close(*fd); return 0; -} - -/* Return a pointer to an fd, self-closing and attached to this pathname. */ -int *talloc_open(const char *pathname, int flags, int mode) -{ - int *fd; - - fd = talloc(pathname, int); - *fd = open(pathname, flags, mode); - if (*fd < 0) { - int saved_errno = errno; - talloc_free(fd); - errno = saved_errno; - return NULL; - } - talloc_set_destructor(fd, destroy_fd); - return fd; } /* Is child a subnode of parent, or equal? */ --Boundary-00=_aRGfInd5HUUkwPy Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_aRGfInd5HUUkwPy--