summaryrefslogtreecommitdiff
path: root/lib/grantpt.c
diff options
context:
space:
mode:
authorPavel Fedin <p.fedin@samsung.com>2015-07-01 10:18:11 +0300
committerPádraig Brady <P@draigBrady.com>2015-07-01 10:10:12 +0100
commit9ba6a0085c72902f8ac30e4378db54fe7f2ff7d6 (patch)
tree0afcf00d559b1263572eeda6b018423dec6387b2 /lib/grantpt.c
parent716083c1a8ea4580e09d35f96b67f8bd875c0fe3 (diff)
downloadgnulib-9ba6a0085c72902f8ac30e4378db54fe7f2ff7d6.tar.gz
fix pty related tests issues on Windows
* lib/grantpt.c (grantpt): grantpt.c seems to be never used on Windows, however it's still present in tests/ subdirectory of the final project. Therefore avoid it to pass `make check`. * tests/test-openpty.c (main): Windows has no PTYs and gnulib's openpty() will just return -ENOSYS, so avoid this non applicable test allowing the build to proceed.
Diffstat (limited to 'lib/grantpt.c')
-rw-r--r--lib/grantpt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/grantpt.c b/lib/grantpt.c
index a740091bad..1a48645c56 100644
--- a/lib/grantpt.c
+++ b/lib/grantpt.c
@@ -46,9 +46,10 @@
int
grantpt (int fd)
{
-#if defined __OpenBSD__
+#if defined __OpenBSD__ || defined _WIN32
/* On OpenBSD, master and slave of a pseudo-terminal are allocated together,
- through an ioctl on /dev/ptm. There is no need for grantpt(). */
+ through an ioctl on /dev/ptm. On Windows there are no ptys.
+ Therefore in either case there is no need for grantpt(). */
return 0;
#else
/* This function is most often called from a process without 'root'