[Libvir] Latest MinGW patch (updated)

Jim Meyering jim at meyering.net
Thu Dec 6 19:45:09 UTC 2007


"Richard W.M. Jones" <rjones at redhat.com> wrote:

> Updated patch attached.  Instructions are the same as before, except
> that I've switched over to a slightly more reliable XDR implementation
> which you can download here:
>
> http://www.annexia.org/tmp/xdr-4.0-mingw2-rwmj1.tar.gz
>
> Status: everything compiles.  Final link fails because of some problem
> with the binary GnuTLS library which I got yesterday.

Nice.
+1 with one suggestion:

> Index: src/virsh.c
> ===================================================================
> RCS file: /data/cvs/libvirt/src/virsh.c,v
> retrieving revision 1.118
> diff -u -r1.118 virsh.c
...
> +#ifndef __MINGW32__
> +#define LOGFILE_FLAGS (O_WRONLY | O_APPEND | O_CREAT | O_SYNC)
> +#else
> +#define LOGFILE_FLAGS (O_WRONLY | O_APPEND | O_CREAT)
> +#endif

Instead of that, you can avoid both the duplication and a platform
specific #ifdef:

#ifndef O_SYNC
# define O_SYNC 0
#endif
#define LOGFILE_FLAGS (O_WRONLY | O_APPEND | O_CREAT | O_SYNC)

>      /* log file open */
> -    if ((ctl->log_fd = open(ctl->logfile, O_WRONLY | O_APPEND | O_CREAT | O_SYNC, FILE_MODE)) < 0) {
> +    if ((ctl->log_fd = open(ctl->logfile, LOGFILE_FLAGS, FILE_MODE)) < 0) {
>          vshError(ctl, TRUE, _("failed to open the log file. check the log file path"));




More information about the libvir-list mailing list