[Spice-devel] [vdagent-linux v2 2/2] vdagent: Favour access() over stat()

Christophe Fergeau cfergeau at redhat.com
Wed Jan 30 12:49:29 UTC 2019


On Wed, Jan 30, 2019 at 01:43:51PM +0100, Christophe Fergeau wrote:
> Hey,
> 
> On Wed, Jan 30, 2019 at 01:36:40PM +0100, Jakub Janku wrote:
> > > diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
> > > index ff3328c..b077d1d 100644
> > > --- a/src/vdagent/vdagent.c
> > > +++ b/src/vdagent/vdagent.c
> > > @@ -20,6 +20,7 @@
> > >  */
> > >  #include <config.h>
> > >
> > > +#include <stdbool.h>
> > 
> > Why this include here? Can't we just use gboolean instead of bool,
> > like in the rest of the file?
> 
> In spice-server, we favour bool over gboolean as it's slightly better
> from a type-safety perspective (bool is a different type from int to the
> C compiler, while gboolean is a typedef for an int, thus bool/int
> mismatches trigger warnings that gboolean would not). However, ack to
> the consistency argument, I'll switch to gboolean here.

And actually we can use g_file_test rather than reinventing the wheel.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190130/ee4c7401/attachment.sig>


More information about the Spice-devel mailing list