1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-10-15 19:35:53 +03:00

build: fix getcwd portability problems

* bootstrap.conf (gnulib_modules): Add getcwd-lgpl.
* tests/commandtest.c (checkoutput): Drop unused cwd.
* tests/commandhelper.c (main): Let getcwd malloc.
* tests/testutils.c (virTestMain): Likewise.
* tools/virsh.c (cmdPwd): Likewise.
(virshCmds): Expose cmdPwd and cmdCd on mingw.
This commit is contained in:
Eric Blake
2011-04-29 11:14:23 -06:00
parent 20986e58aa
commit e39c46a5fd
5 changed files with 20 additions and 36 deletions

View File

@@ -49,15 +49,11 @@ mymain(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
static int checkoutput(const char *testname)
{
int ret = -1;
char cwd[1024];
char *expectname = NULL;
char *expectlog = NULL;
char *actualname = NULL;
char *actuallog = NULL;
if (!getcwd(cwd, sizeof(cwd)))
return -1;
if (virAsprintf(&expectname, "%s/commanddata/%s.log", abs_srcdir,
testname) < 0)
goto cleanup;