[libvirt] [PATCH] tests: Initialize virRandom in for test suite.

Otherwise any virRandom calls will result in a segfault. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- tests/testutils.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 536441a..e6f5e61 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -340,7 +340,8 @@ int virtTestMain(int argc, #endif if (virThreadInitialize() < 0 || - virErrorInitialize() < 0) + virErrorInitialize() < 0 || + virRandomInitialize(time(NULL) ^ getpid())) return 1; if ((debugStr = getenv("VIR_TEST_DEBUG")) != NULL) { -- 1.6.0.6

On Fri, Oct 16, 2009 at 11:59:20AM -0400, Cole Robinson wrote:
Otherwise any virRandom calls will result in a segfault.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- tests/testutils.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tests/testutils.c b/tests/testutils.c index 536441a..e6f5e61 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -340,7 +340,8 @@ int virtTestMain(int argc, #endif
if (virThreadInitialize() < 0 || - virErrorInitialize() < 0) + virErrorInitialize() < 0 || + virRandomInitialize(time(NULL) ^ getpid())) return 1;
if ((debugStr = getenv("VIR_TEST_DEBUG")) != NULL) {
Sounds fine to me, ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 10/19/2009 08:40 AM, Daniel Veillard wrote:
On Fri, Oct 16, 2009 at 11:59:20AM -0400, Cole Robinson wrote:
Otherwise any virRandom calls will result in a segfault.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- tests/testutils.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tests/testutils.c b/tests/testutils.c index 536441a..e6f5e61 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -340,7 +340,8 @@ int virtTestMain(int argc, #endif
if (virThreadInitialize() < 0 || - virErrorInitialize() < 0) + virErrorInitialize() < 0 || + virRandomInitialize(time(NULL) ^ getpid())) return 1;
if ((debugStr = getenv("VIR_TEST_DEBUG")) != NULL) {
Sounds fine to me, ACK,
Daniel
Pushed now. Thanks, Cole
participants (2)
-
Cole Robinson
-
Daniel Veillard