Cross Reference: 22177995.patch
xref
: /
solaris-x11-s12
/
open-src
/
app
/
luit
/
22177995.patch
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
22177995.patch revision 1641
1641
N/A
---
a/luit.c.orig
Fri Jun 3 00:19:19 2016
1641
N/A
+++
b/luit.c
Wed Jul 6 23:43:47 2016
1641
N/A
@@ -30,6 +30,7 @@
1641
N/A
#include <
string.h
>
1641
N/A
#include <
locale.h
>
1641
N/A
#include <
sys/types.h
>
1641
N/A
+#include <
sys/strredir.h
>
1641
N/A
#include <
fcntl.h
>
1641
N/A
#include <
unistd.h
>
1641
N/A
#include <
errno.h
>
1641
N/A
@@ -64,6 +65,7 @@
1641
N/A
1641
N/A
static volatile int sigwinch_queued = 0;
1641
N/A
static volatile int sigchld_queued = 0;
1641
N/A
+int Console = 0;
1641
N/A
1641
N/A
static int convert(int, int);
1641
N/A
static int condom(int, char **);
1641
N/A
@@ -303,6 +305,9 @@
1641
N/A
FatalError("-encoding requires an argument\n");
1641
N/A
locale_name = argv[i + 1];
1641
N/A
i += 2;
1641
N/A
+ } else if (!strcmp(argv[i], "-C")) {
1641
N/A
+ Console = 1;
1641
N/A
+ i += 1;
1641
N/A
} else if (!strcmp(argv[i], "-p")) {
1641
N/A
pipe_option = 1;
1641
N/A
i += 1;
1641
N/A
@@ -650,6 +655,14 @@
1641
N/A
close_waitpipe(0);
1641
N/A
}
1641
N/A
1641
N/A
+ if (Console) {
1641
N/A
+ int consfd = open("
/dev/console
", O_RDONLY);
1641
N/A
+ if (consfd >= 0) {
1641
N/A
+ if (ioctl(consfd, SRIOCSREDIR, 0) != -1)
1641
N/A
+ close(consfd);
1641
N/A
+ }
1641
N/A
+ }
1641
N/A
+
1641
N/A
execvp(path, argv);
1641
N/A
perror("Couldn't exec");
1641
N/A
ExitProgram(1);