1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
--- a/io.h
+++ b/io.h
@@ -9,5 +9,6 @@
int edup (int oldfd);
int edup2 (int oldfd, int newfd);
FILE* efdopen (int fd, const char *mode);
+void set_progname (const char *name);
#endif
--- a/ttyrec.c
+++ b/ttyrec.c
@@ -42,13 +42,19 @@
/*
* script
*/
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/file.h>
-#include <sys/signal.h>
+#include <sys/wait.h>
+#include <signal.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
@@ -57,7 +63,9 @@
#if defined(SVR4)
#include <fcntl.h>
+#if !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__linux__))
#include <stropts.h>
+#endif
#endif /* SVR4 */
#include <sys/time.h>
@@ -341,7 +349,7 @@
rtt = tt;
#if defined(SVR4)
rtt.c_iflag = 0;
- rtt.c_lflag &= ~(ISIG|ICANON|XCASE|ECHO|ECHOE|ECHOK|ECHONL);
+ rtt.c_lflag &= ~(ISIG|ICANON|ECHO|ECHOE|ECHOK|ECHONL);
rtt.c_oflag = OPOST;
rtt.c_cc[VINTR] = CDEL;
rtt.c_cc[VQUIT] = CDEL;
@@ -449,6 +457,7 @@
perror("open(fd, O_RDWR)");
fail();
}
+#ifndef __linux__
if (isastream(slave)) {
if (ioctl(slave, I_PUSH, "ptem") < 0) {
perror("ioctl(fd, I_PUSH, ptem)");
@@ -466,6 +475,7 @@
#endif
(void) ioctl(0, TIOCGWINSZ, (char *)&win);
}
+#endif
#else /* !SVR4 */
#ifndef HAVE_openpty
line[strlen("/dev/")] = 't';
|