Re: [spice-xpi 10/12] Add helper function to get client paths

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

 



On Tue, Mar 12, 2013 at 01:32:13PM +0100, Marc-André Lureau wrote:
> On Tue, Mar 12, 2013 at 12:23 PM, Christophe Fergeau
> <cfergeau@xxxxxxxxxx> wrote:
> > void SpiceController::GetClientPaths(GStrv *client_argv, GStrv *fallback_argv)
> > +{
> > +    if (client_argv != NULL) {
> > +        *client_argv = g_new0(char *, 2);
> > +        (*client_argv)[0] = g_strdup("/usr/libexec/spice-xpi-client");
> > +    }
> > +
> > +    if (fallback_argv != NULL) {
> > +        *client_argv = g_new0(char *, 3);
> > +        (*client_argv)[0] = g_strdup("/usr/bin/spicec");
> > +        (*client_argv)[1] = g_strdup("--controller");
> > +    }
> > +}
> 
> any reason this needs to be allocated? I would rather see a static const array.

Yup, the Windows version of this function will be using dynamic allocation
as we need to get the client name from the registry, split it, ...
see
http://cgit.freedesktop.org/~teuf/spice-xpi/tree/SpiceXPI/src/plugin/controller-win.cpp?h=mingw#n151

> Also, I don't see why it should be returned by the same function.

Good point, I can split it.

Christophe

Attachment: pgpip8yxRBeuc.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]