All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] ioemu: use asprintf instead of PATH_MAX
Date: Wed, 23 Jan 2008 17:20:05 +0000	[thread overview]
Message-ID: <20080123172005.GI5188@implementation.uk.xensource.com> (raw)

Use asprintf instead of PATH_MAX, which POSIX says to be facultative.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>

diff -r c364f80eb4b5 tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c	Wed Jan 23 13:27:21 2008 +0000
+++ b/tools/ioemu/target-i386-dm/helper2.c	Wed Jan 23 17:18:56 2008 +0000
@@ -635,7 +635,7 @@
     extern int suspend_requested;
     CPUState *env = cpu_single_env;
     int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
-    char qemu_file[PATH_MAX];
+    char *qemu_file;
     fd_set fds;
     int ret = 0;
 
@@ -665,9 +665,9 @@
         main_loop_wait(1); /* For the select() on events */
 
         /* Save the device state */
-        snprintf(qemu_file, sizeof(qemu_file), 
-                 "/var/lib/xen/qemu-save.%d", domid);
+        asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid);
         do_savevm(qemu_file);
+        free(qemu_file);
 
         xenstore_record_dm_state("paused");

             reply	other threads:[~2008-01-23 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 17:20 Samuel Thibault [this message]
2008-01-23 20:53 ` ioemu: use asprintf instead of PATH_MAX Mike D. Day
2008-01-24  1:38   ` Samuel Thibault
2008-01-24 14:45     ` Mike D. Day
2008-01-24 14:56       ` Keir Fraser

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=20080123172005.GI5188@implementation.uk.xensource.com \
    --to=samuel.thibault@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.