All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 10/22] libxc: suspend: Fix suspend event channel locking
Date: Tue, 18 Mar 2014 09:44:27 +0100	[thread overview]
Message-ID: <20140318084426.GA16621@aepfle.de> (raw)
In-Reply-To: <1395063006-6671-11-git-send-email-ian.jackson@eu.citrix.com>

On Mon, Mar 17, Ian Jackson wrote:

> +#define SUSPEND_FILE_BUFLEN (sizeof(SUSPEND_LOCK_FILE) + 10)
> +
> +static void get_suspend_file(char buf[SUSPEND_FILE_BUFLEN], int domid)
>  {
> -    int fd, rc;
> -    mode_t mask;
> -    char buf[128];
> -    char suspend_file[256];
> -
> -    snprintf(suspend_file, sizeof(suspend_file), "%s_%d_lock.d",
> -	    SUSPEND_LOCK_FILE, domid);
> -    mask = umask(022);
> -    fd = open(suspend_file, O_CREAT | O_EXCL | O_RDWR, 0666);
> -    if (fd < 0)
> -    {
> -        ERROR("Can't create lock file for suspend event channel %s\n",
> -		suspend_file);
> -        return -EINVAL;
> +    snprintf(buf, sizeof(buf), SUSPEND_LOCK_FILE, domid);
> +}

This fails with newer gcc, such as gcc-4.8:

xc_suspend.c: In function 'get_suspend_file':
xc_suspend.c:39:25: error: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
     snprintf(buf, sizeof(buf), SUSPEND_LOCK_FILE, domid);
                         ^
cc1: all warnings being treated as errors

Olaf

  reply	other threads:[~2014-03-18  8:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 13:29 [PATCH v3 RESEND 00/22] libxl: asynchronous suspend Ian Jackson
2014-03-17 13:29 ` [PATCH 01/22] libxl: init: Provide a gc later in libxl_ctx_alloc Ian Jackson
2014-03-17 13:29 ` [PATCH 02/22] libxl: init: libxl__poller_init and _get take gc Ian Jackson
2014-03-17 13:29 ` [PATCH 03/22] libxl: events: const-correct *_inuse, *_isregistered Ian Jackson
2014-03-17 13:29 ` [PATCH 04/22] libxl: Formally document libxl__xs_transaction Ian Jackson
2014-03-17 13:38   ` Ian Campbell
2014-03-17 13:29 ` [PATCH 05/22] libxl: events: Provide libxl__xswait_* Ian Jackson
2014-03-17 13:29 ` [PATCH 06/22] libxl: events: libxl__xswait* support @paths Ian Jackson
2014-03-17 13:29 ` [PATCH 07/22] libxl: events: Use libxl__xswait_* in spawn code Ian Jackson
2014-03-17 13:29 ` [PATCH 08/22] libxl: events: Provide libxl__ev_evtchn* Ian Jackson
2014-03-17 13:29 ` [PATCH 09/22] libxc: suspend: Rename, improve xc_suspend_evtchn_init Ian Jackson
2014-03-17 13:29 ` [PATCH 10/22] libxc: suspend: Fix suspend event channel locking Ian Jackson
2014-03-18  8:44   ` Olaf Hering [this message]
2014-03-17 13:29 ` [PATCH 11/22] libxl: suspend: trailing ws in libxl_save_msgs_gen.pl Ian Jackson
2014-03-17 13:38   ` Ian Campbell
2014-03-17 13:29 ` [PATCH 12/22] libxl: suspend: Async libxl__domain_suspend_callback Ian Jackson
2014-03-17 13:29 ` [PATCH 13/22] libxl: suspend: Async domain_suspend_callback_common Ian Jackson
2014-03-17 13:29 ` [PATCH 14/22] libxl: suspend: Reorg domain_suspend_callback_common Ian Jackson
2014-03-17 13:29 ` [PATCH 15/22] libxl: suspend: New libxl__domain_pvcontrol_xspath Ian Jackson
2014-03-17 13:30 ` [PATCH 16/22] libxl: suspend: New domain_suspend_pvcontrol_acked Ian Jackson
2014-03-17 13:30 ` [PATCH 17/22] libxl: suspend: domain_suspend_callback_common xs errs Ian Jackson
2014-03-17 13:30 ` [PATCH 18/22] libxl: suspend: Async xenstore pvcontrol wait Ian Jackson
2014-03-17 13:39   ` Ian Campbell
2014-03-17 13:30 ` [PATCH 19/22] libxl: suspend: Abolish usleeps in domain suspend wait Ian Jackson
2014-03-17 13:39   ` Ian Campbell
2014-03-17 13:30 ` [PATCH 20/22] libxl: suspend: Fix suspend wait corner cases Ian Jackson
2014-03-17 13:30 ` [PATCH 21/22] libxl: suspend: Async evtchn wait Ian Jackson
2014-03-17 13:30 ` [PATCH 22/22] libxl: suspend: Apply guest timeout in evtchn case Ian Jackson
2014-03-17 15:55 ` [PATCH v3 RESEND 00/22] libxl: asynchronous suspend 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=20140318084426.GA16621@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=Ian.Campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=stefano.stabellini@eu.citrix.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.