aboutsummaryrefslogtreecommitdiffstats
path: root/x11/kdebase4-workspace/files/patch-TEPty.C
diff options
context:
space:
mode:
Diffstat (limited to 'x11/kdebase4-workspace/files/patch-TEPty.C')
-rw-r--r--x11/kdebase4-workspace/files/patch-TEPty.C83
1 files changed, 3 insertions, 80 deletions
diff --git a/x11/kdebase4-workspace/files/patch-TEPty.C b/x11/kdebase4-workspace/files/patch-TEPty.C
index 9bfd5db25ccd..796ec243efbf 100644
--- a/x11/kdebase4-workspace/files/patch-TEPty.C
+++ b/x11/kdebase4-workspace/files/patch-TEPty.C
@@ -1,83 +1,6 @@
---- konsole/src/TEPty.C.orig Fri Dec 8 11:51:24 2000
-+++ konsole/src/TEPty.C Fri Dec 8 11:52:51 2000
-@@ -180,27 +180,57 @@
- // param grant: 1 to grant, 0 to revoke
- // returns 1 on success 0 on fail
- {
-- pid_t pid = fork();
-- if (pid < 0)
-- {
-- return 0;
-- }
-- if (pid == 0)
-- {
-- /* We pass the master pseudo terminal as file descriptor PTY_FILENO. */
-- if (fd != PTY_FILENO && dup2(fd, PTY_FILENO) < 0) exit(1);
-- QString path = locate("exe", BASE_CHOWN);
-+ pid_t pid;
-+ int pstat;
-+ struct sigaction ign;
-+ struct sigaction intact; // interupt action
-+ struct sigaction quitact; // quit action
-+ sigset_t newsigblock, oldsigblock;
-+ QString path;
-+
-+ ign.sa_handler = SIG_IGN;
-+ sigemptyset(&ign.sa_mask);
-+ ign.sa_flags = 0;
-+ sigaction(SIGINT, &ign, &intact);
-+ sigaction(SIGQUIT, &ign, &quitact);
-+ sigemptyset(&newsigblock);
-+ sigaddset(&newsigblock, SIGCHLD);
-+ sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
-+
-+ switch (pid = fork()) {
-+ case -1:
-+ return(0);
-+ break;
-+ case 0: // child
-+ if (fd != PTY_FILENO && dup2(fd, PTY_FILENO) < 0)
-+ exit(1);
-+ path = locate("exe", BASE_CHOWN);
-+
-+ sigaction(SIGINT, &intact, NULL);
-+ sigaction(SIGQUIT, &quitact, NULL);
-+ sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
- execle(path.ascii(), BASE_CHOWN, grant?"--grant":"--revoke", NULL, NULL);
-- exit(1); // should not be reached
-- }
-- if (pid > 0)
-- { int w;
-- retry:
-- int rc = waitpid (pid, &w, 0);
-- if ((rc == -1) && (errno == EINTR))
-- goto retry;
-- return (rc != -1 && WIFEXITED(w) && WEXITSTATUS(w) == 0);
-+ exit(1);
-+ break;
-+ default:
-+ do {
-+ pid = waitpid(pid, &pstat, 0);
-+ } while (pid == -1 && errno == EINTR);
-+ break;
- }
-+ sigaction(SIGINT, &intact, NULL);
-+ sigaction(SIGQUIT, &quitact, NULL);
-+ sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
-+
-+ if (pid == -1) {
-+ return 0;
-+ }
-+ else if (WIFEXITED(pstat) && (WEXITSTATUS(pstat) == 0)) {
-+ return 1;
-+ }
-+ else {
-+ return 0;
-+ }
- return 0; //dummy.
- }
-
-@@ -225,7 +255,7 @@
+--- konsole/src/TEPty.C Sun Feb 18 10:28:28 2001
++++ konsole/src/TEPty.C.new Fri Feb 23 02:55:58 2001
+@@ -238,7 +238,7 @@
#ifdef HAVE_UTEMPTER
removeLineFromUtmp(ttynam, fd);
#elif defined(USE_LOGIN)