[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 10 of 18] tools/libvchan: fix build errors caused by -Werror in node-select.c


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Fri, 30 Mar 2012 10:25:27 +0200
  • Delivery-date: Fri, 30 Mar 2012 08:26:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1333046730 -7200
# Node ID 1092e073b88e0aed775eec6d7349f310229e9aed
# Parent  ee47e3c3324cc97c90df81ffd60941d61a15c4ae
tools/libvchan: fix build errors caused by -Werror in node-select.c

-O2 -Wall -Werror triggers these warnings:

node-select.c:57:6: warning: function declaration isn't a prototype 
[-Wstrict-prototypes]
node-select.c: In function 'vchan_wr':
node-select.c:60:2: warning: ISO C90 forbids mixed declarations and code 
[-Wdeclaration-after-statement]
node-select.c: At top level:
node-select.c:71:6: warning: function declaration isn't a prototype 
[-Wstrict-prototypes]
node-select.c: In function 'stdout_wr':
node-select.c:74:2: warning: ISO C90 forbids mixed declarations and code 
[-Wdeclaration-after-statement]

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r ee47e3c3324c -r 1092e073b88e tools/libvchan/node-select.c
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -54,10 +54,13 @@ int insiz = 0;
 int outsiz = 0;
 struct libxenvchan *ctrl = 0;
 
-void vchan_wr() {
+void vchan_wr(void)
+{
+       int ret;
+
        if (!insiz)
                return;
-       int ret = libxenvchan_write(ctrl, inbuf, insiz);
+       ret = libxenvchan_write(ctrl, inbuf, insiz);
        if (ret < 0) {
                fprintf(stderr, "vchan write failed\n");
                exit(1);
@@ -68,10 +71,13 @@ void vchan_wr() {
        }
 }
 
-void stdout_wr() {
+void stdout_wr(void)
+{
+       int ret;
+
        if (!outsiz)
                return;
-       int ret = write(1, outbuf, outsiz);
+       ret = write(1, outbuf, outsiz);
        if (ret < 0 && errno != EAGAIN)
                exit(1);
        if (ret > 0) {

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.