xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xen.org>
To: Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xensource.com
Subject: Re: [PATCH 03 of 45] gcc-4.6 compile fix: tools/xenstore/xenstored_core.c
Date: Fri, 20 May 2011 09:21:23 +0100	[thread overview]
Message-ID: <C9FBE313.2D7D9%keir@xen.org> (raw)
In-Reply-To: <cb0ed92e451d06789cb1.1305831922@probook.site>

On 19/05/2011 20:05, "Olaf Hering" <olaf@aepfle.de> wrote:

> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1305824384 -7200
> # Node ID cb0ed92e451d06789cb1a0ba14967bda3a7a5bcb
> # Parent  9c492ce99bbe24e1b4bbe43c754f136ac19a372f
> gcc-4.6 compile fix: tools/xenstore/xenstored_core.c
> 
> xenstored_core.c: In function 'trace':
> xenstored_core.c:133:11: error: variable 'dummy' set but not used
> [-Werror=unused-but-set-variable]
> xenstored_core.c: In function 'trigger_reopen_log':
> xenstored_core.c:203:6: error: variable 'dummy' set but not used
> [-Werror=unused-but-set-variable]

I applied the first couple of these patches, but... We don't set
-Werror=unused-but-set-variable, so we don't actually need these fixes, do
we? Unless they are cleanups or fixes in some other way?

 -- Keir

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> diff -r 9c492ce99bbe -r cb0ed92e451d tools/xenstore/xenstored_core.c
> --- a/tools/xenstore/xenstored_core.c Thu May 19 18:59:42 2011 +0200
> +++ b/tools/xenstore/xenstored_core.c Thu May 19 18:59:44 2011 +0200
> @@ -130,7 +130,7 @@ void trace(const char *fmt, ...)
> va_list arglist;
> char *str;
> char sbuf[1024];
> - int ret, dummy;
> + int ret;
>  
> if (tracefd < 0)
> return;
> @@ -141,7 +141,10 @@ void trace(const char *fmt, ...)
> va_end(arglist);
>  
> if (ret <= 1024) {
> -  dummy = write(tracefd, sbuf, ret);
> +  if (write(tracefd, sbuf, ret) < 0) {
> +   close(tracefd);
> +   tracefd = -1;
> +  }
> return;
> }
>  
> @@ -149,7 +152,10 @@ void trace(const char *fmt, ...)
> va_start(arglist, fmt);
> str = talloc_vasprintf(NULL, fmt, arglist);
> va_end(arglist);
> - dummy = write(tracefd, str, strlen(str));
> + if (write(tracefd, str, strlen(str)) < 0) {
> +  close(tracefd);
> +  tracefd = -1;
> + }
> talloc_free(str);
>  }
>  
> @@ -200,8 +206,12 @@ void trace_destroy(const void *data, con
>  static void trigger_reopen_log(int signal __attribute__((unused)))
>  {
> char c = 'A';
> - int dummy;
> - dummy = write(reopen_log_pipe[1], &c, 1);
> + if (reopen_log_pipe[1] < 0)
> +  return;
> + if (write(reopen_log_pipe[1], &c, 1) < 0) {
> +  close(reopen_log_pipe[1]);
> +  reopen_log_pipe[1] = -1;
> + }
>  }
>  
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-05-20  8:21 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 19:05 [PATCH 00 of 45] gcc 4.6 compile fixes for xen-unstable Olaf Hering
2011-05-19 19:05 ` [PATCH 01 of 45] gcc-4.6 compile fix: tools/libxc/xc_tmem.c Olaf Hering
2011-05-19 19:05 ` [PATCH 02 of 45] gcc-4.6 compile fix: tools/libxc/xc_domain_restore.c Olaf Hering
2011-05-19 19:05 ` [PATCH 03 of 45] gcc-4.6 compile fix: tools/xenstore/xenstored_core.c Olaf Hering
2011-05-20  8:21   ` Keir Fraser [this message]
2011-05-20  8:30     ` Ian Campbell
2011-05-20  8:41       ` Keir Fraser
2011-05-20 14:38         ` Olaf Hering
2011-05-20 14:58           ` Keir Fraser
2011-05-20 16:11             ` Olaf Hering
2011-05-21  6:50               ` Keir Fraser
2011-05-20  8:35     ` Olaf Hering
2011-05-19 19:05 ` [PATCH 04 of 45] gcc-4.6 compile fix: tools/misc/gtraceview.c Olaf Hering
2011-05-19 19:05 ` [PATCH 05 of 45] gcc-4.6 compile fix: tools/xcutils/xc_restore.c Olaf Hering
2011-05-19 19:05 ` [PATCH 06 of 45] gcc-4.6 compile fix: tools/firmware/rombios/32bit/tcgbios/tcgbios.c Olaf Hering
2011-05-19 19:05 ` [PATCH 07 of 45] gcc-4.6 compile fix: tools/console/client/main.c Olaf Hering
2011-05-19 19:05 ` [PATCH 08 of 45] gcc-4.6 compile fix: tools/xenstat/xentop/xentop.c Olaf Hering
2011-05-19 19:05 ` [PATCH 09 of 45] gcc-4.6 compile fix: tools/libxl/xl_cmdimpl.c Olaf Hering
2011-05-19 19:05 ` [PATCH 10 of 45] gcc-4.6 compile fix: tools/libxl/libxlu_cfg.c Olaf Hering
2011-05-19 19:05 ` [PATCH 11 of 45] gcc-4.6 compile fix: tools/libxl/libxl.c Olaf Hering
2011-05-19 19:05 ` [PATCH 12 of 45] gcc-4.6 compile fix: tools/libxl/libxl_pci.c Olaf Hering
2011-05-19 19:05 ` [PATCH 13 of 45] gcc-4.6 compile fix: tools/libxl/libxl_dom.c Olaf Hering
2011-05-19 19:05 ` [PATCH 14 of 45] gcc-4.6 compile fix: tools/libxl/libxl_utils.c Olaf Hering
2011-05-19 19:05 ` [PATCH 15 of 45] gcc-4.6 compile fix: tools/debugger/gdbsx/gx/gx_comm.c Olaf Hering
2011-05-19 19:05 ` [PATCH 16 of 45] gcc-4.6 compile fix: tools/python/xen/lowlevel/checkpoint/libcheckpoint.c Olaf Hering
2011-05-19 19:05 ` [PATCH 17 of 45] gcc-4.6 compile fix: tools/python/xen/lowlevel/netlink/libnetlink.c Olaf Hering
2011-05-19 19:05 ` [PATCH 18 of 45] gcc-4.6 compile fix: xen/common/cpupool.c Olaf Hering
2011-05-20  7:43   ` Jan Beulich
2011-05-19 19:05 ` [PATCH 19 of 45] gcc-4.6 compile fix: xen/common/grant_table.c Olaf Hering
2011-05-19 19:05 ` [PATCH 20 of 45] gcc-4.6 compile fix: xen/common/kexec.c Olaf Hering
2011-05-19 19:05 ` [PATCH 21 of 45] gcc-4.6 compile fix: xen/common/sched_credit2.c Olaf Hering
2011-05-19 19:05 ` [PATCH 22 of 45] gcc-4.6 compile fix: xen/common/unlzo.c Olaf Hering
2011-05-19 19:05 ` [PATCH 23 of 45] gcc-4.6 compile fix: xen/drivers/passthrough/vtd/intremap.c Olaf Hering
2011-05-19 19:05 ` [PATCH 24 of 45] gcc-4.6 compile fix: xen/arch/x86/msi.c Olaf Hering
2011-05-19 19:05 ` [PATCH 25 of 45] gcc-4.6 compile fix: xen/arch/x86/microcode_amd.c Olaf Hering
2011-05-19 19:05 ` [PATCH 26 of 45] gcc-4.6 compile fix: xen/arch/x86/time.c Olaf Hering
2011-05-19 19:05 ` [PATCH 27 of 45] gcc-4.6 compile fix: xen/arch/x86/acpi/cpu_idle.c Olaf Hering
2011-05-20  7:52   ` Jan Beulich
2011-05-19 19:05 ` [PATCH 28 of 45] gcc-4.6 compile fix: xen/arch/x86/cpu/amd.c Olaf Hering
2011-05-19 19:05 ` [PATCH 29 of 45] gcc-4.6 compile fix: xen/arch/x86/cpu/intel.c Olaf Hering
2011-05-20  7:55   ` Jan Beulich
2011-05-20  8:38     ` Keir Fraser
2011-05-19 19:05 ` [PATCH 30 of 45] gcc-4.6 compile fix: xen/arch/x86/cpu/intel_cacheinfo.c Olaf Hering
2011-05-19 19:05 ` [PATCH 31 of 45] gcc-4.6 compile fix: xen/arch/x86/cpu/mcheck/mce.c Olaf Hering
2011-05-19 19:05 ` [PATCH 32 of 45] gcc-4.6 compile fix: xen/arch/x86/hvm/emulate.c Olaf Hering
2011-05-19 19:05 ` [PATCH 33 of 45] gcc-4.6 compile fix: xen/arch/x86/hvm/hvm.c Olaf Hering
2011-05-19 19:05 ` [PATCH 34 of 45] gcc-4.6 compile fix: xen/arch/x86/hvm/viridian.c Olaf Hering
2011-05-19 19:05 ` [PATCH 35 of 45] gcc-4.6 compile fix: xen/arch/x86/mm/p2m-pod.c Olaf Hering
2011-05-19 19:05 ` [PATCH 36 of 45] gcc-4.6 compile fix: xen/arch/x86/mm/mem_sharing.c Olaf Hering
2011-05-19 19:05 ` [PATCH 37 of 45] gcc-4.6 compile fix: xen/arch/x86/x86_64/mm.c Olaf Hering
2011-05-19 19:05 ` [PATCH 38 of 45] gcc-4.6 compile fix: xen/arch/x86/mm.c Olaf Hering
2011-05-19 19:05 ` [PATCH 39 of 45] gcc-4.6 compile fix: xen/arch/x86/cpu/mcheck/vmce.c Olaf Hering
2011-05-19 19:05 ` [PATCH 40 of 45] gcc-4.6 compile fix: xen/common/tmem.c Olaf Hering
2011-05-19 19:06 ` [PATCH 41 of 45] gcc-4.6 compile fix: xen/common/tmem_xen.c Olaf Hering
2011-05-19 19:06 ` [PATCH 42 of 45] gcc-4.6 compile fix: xen/arch/x86/mm/p2m.c Olaf Hering
2011-05-19 19:06 ` [PATCH 43 of 45] gcc-4.6 compile fix: xen/arch/x86/mm/shadow/multi.c Olaf Hering
2011-05-19 19:06 ` [PATCH 44 of 45] gcc-4.6 compile fix: xen/arch/x86/traps.c Olaf Hering
2011-05-20  8:12   ` Jan Beulich
2011-05-19 19:06 ` [PATCH 45 of 45] gcc-4.6 compile fix: xen/arch/x86/domain_build.c Olaf Hering
2011-05-20  7:38 ` [PATCH 00 of 45] gcc 4.6 compile fixes for xen-unstable Jan Beulich
2011-05-20  7:44   ` Olaf Hering
2011-05-20  8:28   ` Ian Campbell
2011-05-20  8:39     ` Keir Fraser
2011-05-20 17:23       ` Ian Jackson

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=C9FBE313.2D7D9%keir@xen.org \
    --to=keir@xen.org \
    --cc=olaf@aepfle.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).