[libvirt] [PATCHv3] build: fix virBufferVasprintf on mingw

Matthias Bolte matthias.bolte at googlemail.com
Thu Jul 7 18:49:21 UTC 2011


2011/7/6 Eric Blake <eblake at redhat.com>:
> Gnulib documents that mingw vsnprintf is broken (it returns -1
> on out-of-space, instead of the count of what would have been
> printed); but while we were using the snprintf wrapper, we had
> not yet been using the vsnprintf wrapper.
>
> Meanwhile, mingw (but not mingw64) has a replacement snprintf
> that fixes return values, but still lacks %1$s support; so in
> that case, gnulib didn't replace snprintf, but libintl then
> went ahead and installed a version that supported %1$s but not
> return values.  Gnulib has since been fixed to guarantee that
> the snprintf module will always guarantee the constraints needed
> by libintl.
>
> Also, we want to guarantee that strdup sets errno on failure.
>
> * .gnulib: Update to latest, for vsnprintf fix.
> * bootstrap.conf (gnulib_modules): Add vsnprintf, strdup-posix.
> Reported by Matthias Bolte.
> ---
>
> v3: more gnulib updates, also fix strdup
> v2: see https://www.redhat.com/archives/libvir-list/2011-July/msg00042.html
>
> * .gnulib 7269b35...8db4963 (23):
>  > sys_select: define sigset_t more portably
>  > * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Poison pselect.
>  > pselect: Use pthread_sigmask, not sigprocmask.
>  > modules/pselect: Add Bruno and Jim to maintainers.
>  > * modules/pselect: Add select, LIBSOCKET.
>  > * lib/pselect.c (pselect): Use plain name, without "rpl_".
>  > pselect: document better
>  > pthread_sigmask: new module
>  > test-pselect: new module
>  > * tests/test-sys_select.c (sigset_t): Test for it, too.
>  > snprintf: guarantee %1$d, for libintl
>  > maint: exempt stdio-read.c and stdio-write.c from the cppi check
>  > maint: indent with spaces, not TABs, and add a rule to check this
>  > maint.mk: correct omissions in prohibit_argmatch_without_use check
>  > Comments about EINTR.
>  > autoupdate
>  > xnanosleep: Rewrite to use new dtotimespec module.
>  > timespec-add, timespec-sub: new modules
>  > dtotimespec: new module
>  > * lib/timespec.h (timespectod): New inline function.
>  > * lib/timespec.h (timespec_sign): New inline function.
>  > pselect: new module
>  > sys_select: don't depend on sys_socket
>
> I'm also investigating how easy it would be to use gnulib's new
> pthread_sigmask.
>
>  .gnulib        |    2 +-
>  bootstrap.conf |    2 ++
>  2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/.gnulib b/.gnulib
> index 7269b35..8db4963 160000
> --- a/.gnulib
> +++ b/.gnulib
> @@ -1 +1 @@
> -Subproject commit 7269b35c8d9be1a6f97906b9e29b8c422b92fc31
> +Subproject commit 8db49630deab35ffbce5c113aed093359a75091d
> diff --git a/bootstrap.conf b/bootstrap.conf
> index 581d60b..d3ff150 100644
> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -80,6 +80,7 @@ socket
>  stdarg
>  stpcpy
>  strchrnul
> +strdup-posix
>  strndup
>  strerror
>  strerror_r-posix
> @@ -97,6 +98,7 @@ usleep
>  vasprintf
>  verify
>  vc-list-files
> +vsnprintf
>  waitpid
>  warnings
>  '

Okay, I finally tested this patch and it works, ACK.

-- 
Matthias Bolte
http://photron.blogspot.com




More information about the libvir-list mailing list