]> Dogcows Code - chaz/tar/commitdiff
Don't build ttyemu and run tty I/O test if grantpt is not available.
authorSergey Poznyakoff <gray@gnu.org>
Tue, 22 Jul 2014 01:24:35 +0000 (04:24 +0300)
committerSergey Poznyakoff <gray@gnu.org>
Tue, 22 Jul 2014 01:29:25 +0000 (04:29 +0300)
* configure.ac (TAR_COND_GRANTPT): Define conditional depending
on whether grantpt is available.
* gnulib.modules: Remove grantpt. It relies upon a helper binary
pt_chown which it installs and which is useless in the testsuite.
* tests/Makefile.am [TAR_COND_GRANTPT]: Build ttyemu
* tests/iotty.at: Skip test if ttyemu is not build.
* tests/ttyemu.c (noecho): Fix error message
(main): Use TIOCSCTTY if it is defined.

configure.ac
gnulib.modules
tests/Makefile.am
tests/iotty.at
tests/ttyemu.c

index d39387654ec7d6c53413bf2d30efa701409521bb..d06e540fa77b6fb734fc055bc63f3308b81ffc17 100644 (file)
@@ -204,7 +204,8 @@ fi
 
 TAR_HEADERS_ATTR_XATTR_H
 
-AC_CHECK_FUNCS_ONCE([fchmod fchown fsync lstat mkfifo readlink symlink])
+AC_CHECK_FUNCS_ONCE([fchmod fchown fsync lstat mkfifo readlink symlink grantpt])
+AM_CONDITIONAL([TAR_COND_GRANTPT], [test $ac_cv_func_grantpt = yes])
 
 AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
 AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
index 47371ecdd40d8b36a6ebe7a7b57c651fe9b5954a..0d2e76cfd641f699bb17d3fe6139b57824f604bd 100644 (file)
@@ -50,7 +50,6 @@ getpagesize
 gettext
 gettime
 gitlog-to-changelog
-grantpt
 hash
 human
 inttostr
index fd2def56accfd67708f7349b3eb64932d3cb6937..6684d1d89952ef71a4dc60106442b560936d883d 100644 (file)
@@ -263,7 +263,11 @@ installcheck-local:
 ## genfile      ##
 ## ------------ ##
 
-check_PROGRAMS = genfile ttyemu
+check_PROGRAMS = genfile
+
+if TAR_COND_GRANTPT
+check_PROGRAMS += ttyemu
+endif
 
 genfile_SOURCES = genfile.c argcv.c argcv.h
 
index 79589b755fe925299585e0b433398ad2732c0133..7cbb17800feb298e5c7bdf592af4f7668ceb42b3 100644 (file)
@@ -27,6 +27,7 @@ AT_SETUP([terminal input])
 AT_KEYWORDS([options iotty])
 
 AT_TAR_CHECK([
+test -x $abs_builddir/ttyemu || AT_SKIP_TEST
 TAPE=-
 export TAPE
 ttyemu -t5 -i/dev/null tar -x
index 9137290bc3630c80acf57a086bc6d9427dd8337b..27fed9af2323fa5a29e7a2f497f6ba14422dc2cb 100644 (file)
@@ -188,7 +188,7 @@ noecho (int fd)
   to.c_cc[VEOF] = C_EOT;
   if (tcsetattr (fd, TCSAFLUSH | TCSASOFT, &to))
     {
-      perror ("tcgetattr");
+      perror ("tcsetattr");
       exit (EX_ERR);
     }
 }
@@ -349,8 +349,9 @@ main (int argc, char **argv)
        close (i);
 
       setsid ();
+#ifdef TIOCSCTTY
       ioctl (0, TIOCSCTTY, 1);
-      
+#endif      
       execvp (argv[0], argv);
       perror (argv[0]);
       _exit (EX_EXEC);
This page took 0.02214 seconds and 4 git commands to generate.