53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
--- konsole/src/TEPty.C.orig Tue Oct 3 21:57:30 2000
|
|
+++ konsole/src/TEPty.C Fri Nov 24 17:52:38 2000
|
|
@@ -180,9 +180,14 @@ int chownpty(int fd, int grant)
|
|
// param grant: 1 to grant, 0 to revoke
|
|
// returns 1 on success 0 on fail
|
|
{
|
|
+// XXX
|
|
+ struct sigaction oact;
|
|
+ sigaction(SIGCHLD, NULL, &oact);
|
|
+ signal(SIGCHLD, SIG_DFL);
|
|
pid_t pid = fork();
|
|
if (pid < 0)
|
|
{
|
|
+ sigaction(SIGCHLD, &oact, NULL);
|
|
return 0;
|
|
}
|
|
if (pid == 0)
|
|
@@ -199,6 +204,7 @@ int chownpty(int fd, int grant)
|
|
int rc = waitpid (pid, &w, 0);
|
|
if ((rc == -1) && (errno == EINTR))
|
|
goto retry;
|
|
+ sigaction(SIGCHLD, &oact, NULL);
|
|
return (rc != -1 && WIFEXITED(w) && WEXITSTATUS(w) == 0);
|
|
}
|
|
return 0; //dummy.
|
|
@@ -227,7 +233,11 @@ void TEPty::donePty()
|
|
#elif defined(USE_LOGIN)
|
|
char *tty_name=ttyname(0);
|
|
if (tty_name)
|
|
+ {
|
|
+ if (strncmp(tty_name, "/dev/", 5) == 0)
|
|
+ tty_name += 5;
|
|
logout(tty_name);
|
|
+ }
|
|
#endif
|
|
if (needGrantPty) chownpty(fd,FALSE);
|
|
emit done(status);
|
|
@@ -435,10 +445,13 @@ void TEPty::makePty(const char* dev, con
|
|
l_struct.ut_host[UT_HOSTSIZE]=0;
|
|
}
|
|
|
|
- if (! (str_ptr=ttyname(0)) ) {
|
|
+ if (! (str_ptr=ttyname(tt)) ) {
|
|
abort();
|
|
}
|
|
+ if (strncmp(str_ptr, "/dev/", 5) == 0)
|
|
+ str_ptr += 5;
|
|
strncpy(l_struct.ut_line, str_ptr, UT_LINESIZE);
|
|
+ time(&l_struct.ut_time);
|
|
|
|
login(&l_struct);
|
|
#endif
|