[libvirt] [PATCH] Fix Win32 portability problems
Daniel P. Berrange
berrange at redhat.com
Thu Apr 8 10:45:46 UTC 2010
On Wed, Apr 07, 2010 at 12:12:10PM -0600, Eric Blake wrote:
> > +#ifdef WIN32
> > +int
> > +virHookCall(int driver ATTRIBUTE_UNUSED,
> > + const char *id ATTRIBUTE_UNUSED,
> > + int op ATTRIBUTE_UNUSED,
> > + int sub_op ATTRIBUTE_UNUSED,
> > + const char *extra ATTRIBUTE_UNUSED,
> > + const char *input ATTRIBUTE_UNUSED) {
> > + virReportSystemError(ENOSYS, "%s",
> > + _("spawning hooks not supported on this platform"));
> > + return -1;
>
> Good enough for now. But gnulib supports posix_spawn ported to mingw
> (currently LGPLv3, so we'd have to get it relaxed to LPGLv2 first);
> perhaps if we rewrite hooks to use posix_spawn() instead of
> fork()/exec(), then we can support hooks on mingw.
posix_spawn() isn't really flexible enough to replace the virExec() functionality
> > @@ -8425,7 +8430,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
> > &creation) < 0)
> > continue;
> > localtime_r(&creation, &time_info);
> > - strftime(timestr, sizeof(timestr), "%F %T %z", &time_info);
> > + strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %z", &time_info);
>
> Is this a case where we want localized output? Or is switching to fixed
> format a good move independently of mingw lacking localization? Gnulib
> provides strftime (but it is currently LGPLv3, and would need relaxing),
> if we want to go with localized output.
%F & %T are not localized formats anyway, so this isn't impacting that. THis
is just a straight substitution expanding the shortcuts to the full syntax
Regards,
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list