mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
regex: gnulib guarantees that we have regex support
No need to use HAVE_REGEX_H - our use of gnulib guarantees that the header exists and works, regardless of platform. Similarly, we can unconditionally assume a compiling <sys/wait.h> (although the mingw version of this header is not full-featured). * src/storage/storage_backend.c: Drop useless conditional. * tests/testutils.c: Likewise.
This commit is contained in:
parent
2e5d7798df
commit
ec8a2d0327
@ -25,9 +25,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if HAVE_REGEX_H
|
#include <regex.h>
|
||||||
# include <regex.h>
|
|
||||||
#endif
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* testutils.c: basic test utils
|
* testutils.c: basic test utils
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005-2012 Red Hat, Inc.
|
* Copyright (C) 2005-2013 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -27,12 +27,8 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifndef WIN32
|
#include <sys/wait.h>
|
||||||
# include <sys/wait.h>
|
#include <regex.h>
|
||||||
#endif
|
|
||||||
#ifdef HAVE_REGEX_H
|
|
||||||
# include <regex.h>
|
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -735,7 +731,6 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_REGEX_H
|
|
||||||
int virtTestClearLineRegex(const char *pattern,
|
int virtTestClearLineRegex(const char *pattern,
|
||||||
char *str)
|
char *str)
|
||||||
{
|
{
|
||||||
@ -779,10 +774,3 @@ int virtTestClearLineRegex(const char *pattern,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
int virtTestClearLineRegex(const char *pattern ATTRIBUTE_UNUSED,
|
|
||||||
char *str ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
Loading…
Reference in New Issue
Block a user