mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Fix virFileOpenTty definition on Win32
Stub out a complete impl of virFileOpenTty to avoid unused parameter warnings * src/util/util.c: Fix virFileOpenTty on Win32
This commit is contained in:
parent
7b2723c5c1
commit
646b300773
@ -1099,20 +1099,13 @@ virFileBuildPath(const char *dir, const char *name, const char *ext)
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
int virFileOpenTty(int *ttymaster,
|
int virFileOpenTty(int *ttymaster,
|
||||||
char **ttyName,
|
char **ttyName,
|
||||||
int rawmode)
|
int rawmode)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
/* mingw completely lacks pseudo-terminals, and the gnulib
|
|
||||||
* replacements are not (yet) license compatible. */
|
|
||||||
errno = ENOSYS;
|
|
||||||
|
|
||||||
#else /* !WIN32 */
|
|
||||||
|
|
||||||
if ((*ttymaster = posix_openpt(O_RDWR|O_NOCTTY|O_NONBLOCK)) < 0)
|
if ((*ttymaster = posix_openpt(O_RDWR|O_NOCTTY|O_NONBLOCK)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -1151,9 +1144,19 @@ cleanup:
|
|||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
VIR_FORCE_CLOSE(*ttymaster);
|
VIR_FORCE_CLOSE(*ttymaster);
|
||||||
|
|
||||||
#endif /* !WIN32 */
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
#else /* WIN32 */
|
||||||
|
int virFileOpenTty(int *ttymaster ATTRIBUTE_UNUSED,
|
||||||
|
char **ttyName ATTRIBUTE_UNUSED,
|
||||||
|
int rawmode ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
/* mingw completely lacks pseudo-terminals, and the gnulib
|
||||||
|
* replacements are not (yet) license compatible. */
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Creates an absolute path for a potentially relative path.
|
* Creates an absolute path for a potentially relative path.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user