]> Savannah Git Hosting - gnulib.git/commitdiff
fix pty related tests issues on Windows
authorPavel Fedin <p.fedin@samsung.com>
Wed, 1 Jul 2015 07:18:11 +0000 (10:18 +0300)
committerPádraig Brady <P@draigBrady.com>
Wed, 1 Jul 2015 09:10:12 +0000 (10:10 +0100)
* 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.

ChangeLog
lib/grantpt.c
tests/test-openpty.c

index cc0077da2a2ceac41b807097870de7a80cb7bab5..d64a60696d63cdd98462fa85d8364c955174c162 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-07-01  Pavel Fedin  <p.fedin@samsung.com>
+
+       fix pty related tests issues on Windows (trivial)
+       * 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.
+
 2015-07-01  Pádraig Brady  <P@draigBrady.com>
 
        acl: fix definition of acl_from_mode on FreeBSD
index a740091bad303966552ba4e86fb993f27c4a0de2..1a48645c563ca30683c541d63f35a1cc3e810cec 100644 (file)
 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'
index 9fc4ed2757e9b1f05f80f19e78ce001c2caae12a..ee36fe6e38b18a678c72f8d31c9fd229769528ea 100644 (file)
@@ -34,6 +34,7 @@ int
 main ()
 {
   {
+#ifndef _WIN32
     int master;
     int slave;
 
@@ -103,6 +104,7 @@ main ()
     /* Close the master side before the slave side gets closed.
        This is necessary on Mac OS X 10.4.11.  */
     close (master);
+#endif
   }
 
   return 0;