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

Re: [Xen-devel] [PATCH] xenconsole: Ensure exclusive access to console using locks



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@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®.