On Fri, 2015-07-24 at 14:32 +0100, Ian Jackson wrote:
> 
> 
> > +static void console_lock(int domid)
> > +{
> > +   lockfile = malloc(PATH_MAX);
> > +   if (lockfile == NULL)
> > +           err(ENOMEM, "malloc");
> > +   snprintf(lockfile, PATH_MAX - 1, "%s/xenconsole.%d", 
> > XEN_LOCK_DIR, domid);
> 
> Why not use asprintf ?

I thought that, but it isn't generally available (not on one of the BSDs, I
think) e.g. libxl provides its own (libxl_osdep.c) if configure says it
isn't available.

It's a shame that isn't more generally useful throughout the tree.

But IMHO a static buffer should be fine for this use case.

Ian.

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

Reply via email to