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

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



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


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