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

Re: [libvirt] PATCH: Latest MinGW patches



"Daniel P. Berrange" <berrange redhat com> wrote:
> On Wed, Sep 03, 2008 at 01:35:27PM +0100, Daniel P. Berrange wrote:
>> I've got a MinGW build environment setup on Fedora 10 now, so just checked
>> out what the latest state of libvirt CVS is.
...
> This new version of the patch fixes two small bugs in the original, and
> also adds the mingw-libvirt.spec.in and makes the autobuild.sh script
> build this RPM too, if mingw build chain is present. THis means we will
> get fully validation of the windows compatability for our nightly builds

Looks fine.

> Index: src/storage_backend.c
> ===================================================================
> RCS file: /data/cvs/libvirt/src/storage_backend.c,v
> retrieving revision 1.20
> diff -u -p -r1.20 storage_backend.c
> --- src/storage_backend.c	27 Aug 2008 11:42:52 -0000	1.20
> +++ src/storage_backend.c	3 Sep 2008 16:44:22 -0000
> @@ -24,9 +24,13 @@
>  #include <config.h>
>
>  #include <string.h>
> +#if HAVE_REGEX_H
>  #include <regex.h>
> +#endif
>  #include <sys/types.h>
...

Another option (just to avoid this particular #if/#endif) would
be to add "regexp" to the list of modules pulled in from gnulib.
Probably not worth it right now, though, since the code that would
use it has to remain #ifdef'd out.

...
> Index: src/storage_conf.c
> ===================================================================
> RCS file: /data/cvs/libvirt/src/storage_conf.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 storage_conf.c
> --- src/storage_conf.c	3 Sep 2008 07:12:37 -0000	1.13
> +++ src/storage_conf.c	3 Sep 2008 16:44:22 -0000
> @@ -189,7 +189,11 @@ virStoragePoolDefParsePerms(virConnectPt
>      }
>
>      if (virXPathNode(conn, "/pool/permissions/owner", ctxt) == NULL) {
> +#if HAVE_GETUID
>          perms->uid = getuid();
> +#else
> +        perms->uid = 0;
> +#endif
...
> +#if HAVE_GETGID
> +        perms->gid = getgid();
> +#else
> +        perms->gid = 0;
> +#endif
...
> +#if HAVE_GETUID
>          perms->uid = getuid();
> +#else
> +        perms->uid = 0;
> +#endif
...
> +#if HAVE_GETGID
>          perms->gid = getgid();
> +#else
> +        perms->gid = 0;
> +#endif
...
> Index: src/util.c
> ===================================================================
> RCS file: /data/cvs/libvirt/src/util.c,v
> retrieving revision 1.56

Instead of adding the #if/else blocks above,
how about adding these in some header file?

#ifndef HAVE_GETGID
static inline gid_t getgid (void) { return 0; }
#endif

#ifndef HAVE_GETUID
static inline uid_t getuid (void) { return 0; }
#endif


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