[Libguestfs] [PATCH libguestfs] generator.ml: constify do_mkdtemp

Richard W.M. Jones rjones at redhat.com
Wed Aug 12 07:51:12 UTC 2009


On Wed, Aug 12, 2009 at 09:36:20AM +0200, Jim Meyering wrote:
> Here's the new version:
> 
> char *
> do_mkdtemp (const char *template)
> {
>   char *writable = strdup (template);
>   if (writable == NULL) {
>     reply_with_perror ("strdup");
>     return NULL;
>   }
> 
>   CHROOT_IN;
>   char *r = mkdtemp (writable);
>   CHROOT_OUT;
> 
>   if (r == NULL) {
>     reply_with_perror ("mkdtemp: %s", template);
>     free (writable);
>   }
> 
>   return r;
> }

Looks good to me - ACK.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the Libguestfs mailing list