]> git.pld-linux.org Git - packages/kterm.git/blob - kterm-6.2.0-utmp98.patch
- dropped pre-cvs changelog
[packages/kterm.git] / kterm-6.2.0-utmp98.patch
1 --- kterm-6.2.0/main.c.utempter Fri Mar 26 12:11:35 1999
2 +++ kterm-6.2.0/main.c  Fri Mar 26 12:14:50 1999
3 @@ -1679,11 +1679,12 @@
4   * has problems, we can re-enter this function and get another one.
5   */
6  
7 +int tty;
8 +
9  get_pty (pty)
10      int *pty;
11  {
12 -#ifdef __osf__
13 -    int tty;
14 +#if defined(__osf__) || defined(linux)
15      return (openpty(pty, &tty, ttydev, NULL, NULL));
16  #endif
17  #if defined(SYSV) && defined(i386) && !defined(SVR4)
18 @@ -2323,6 +2324,8 @@
19  #endif /* TIOCSWINSZ */
20  #endif /* sun */
21  
22 +       addToUtmp(ttydev, NULL, screen->respond);
23 +
24         if (!am_slave) {
25  #ifdef USE_HANDSHAKE
26             if (pipe(pc_pipe) || pipe(cp_pipe))
27 @@ -2927,85 +2930,6 @@
28  #endif
29  #endif
30  
31 -               (void) setutent ();
32 -               /* set up entry to search for */
33 -               ptyname = ttydev;
34 -#ifndef __sgi
35 -               if (PTYCHARLEN >= (int)strlen(ptyname))
36 -                   ptynameptr = ptyname;
37 -               else
38 -                   ptynameptr = ptyname + strlen(ptyname) - PTYCHARLEN;
39 -               (void) strncpy(utmp.ut_id, ptynameptr, sizeof (utmp.ut_id));
40 -#else
41 -               (void) strncpy(utmp.ut_id,ptyname + sizeof("/dev/tty")-1,
42 -                              sizeof (utmp.ut_id));
43 -
44 -#endif
45 -               utmp.ut_type = DEAD_PROCESS;
46 -
47 -               /* position to entry in utmp file */
48 -               (void) getutid(&utmp);
49 -
50 -               /* set up the new entry */
51 -               utmp.ut_type = USER_PROCESS;
52 -#ifndef linux
53 -               utmp.ut_exit.e_exit = 2;
54 -#endif
55 -               (void) strncpy(utmp.ut_user,
56 -                              (pw && pw->pw_name) ? pw->pw_name : "????",
57 -                              sizeof(utmp.ut_user));
58 -                   
59 -#ifndef __sgi
60 -               (void)strncpy(utmp.ut_id, ptynameptr, sizeof(utmp.ut_id));
61 -#else
62 -               (void) strncpy(utmp.ut_id,ptyname + sizeof("/dev/tty")-1,
63 -                              sizeof (utmp.ut_id));
64 -#endif
65 -               (void) strncpy (utmp.ut_line,
66 -                       ptyname + strlen("/dev/"), sizeof (utmp.ut_line));
67 -
68 -#ifdef HAS_UTMP_UT_HOST
69 -               (void) strncpy(buf, DisplayString(screen->display),
70 -                              sizeof(buf));
71 -#ifndef linux
72 -               {
73 -                   char *disfin = strrchr(buf, ':');
74 -                   if (disfin)
75 -                       *disfin = '\0';
76 -               }
77 -#endif
78 -               (void) strncpy(utmp.ut_host, buf, sizeof(utmp.ut_host));
79 -#endif
80 -               (void) strncpy(utmp.ut_name, pw->pw_name, 
81 -                              sizeof(utmp.ut_name));
82 -
83 -               utmp.ut_pid = getpid();
84 -#ifdef SVR4
85 -               utmp.ut_session = getsid(0);
86 -               utmp.ut_xtime = time ((Time_t *) 0);
87 -               utmp.ut_tv.tv_usec = 0;
88 -#else
89 -               utmp.ut_time = time ((Time_t *) 0);
90 -#endif
91 -
92 -               /* write out the entry */
93 -               if (!resource.utmpInhibit)
94 -                   (void) pututline(&utmp);
95 -#ifdef WTMP
96 -#ifdef SVR4
97 -               if (term->misc.login_shell)
98 -                   updwtmpx(WTMPX_FILE, &utmp);
99 -#else
100 -               if (term->misc.login_shell &&
101 -                    (i = open(etc_wtmp, O_WRONLY|O_APPEND)) >= 0) {
102 -                   write(i, (char *)&utmp, sizeof(struct utmp));
103 -                   close(i);
104 -               }
105 -#endif
106 -#endif
107 -               /* close the file */
108 -               (void) endutent();
109 -
110  #else  /* USE_SYSV_UTMP */
111                 /* We can now get our ttyslot!  We can also set the initial
112                  * UTMP entry.
113 @@ -3420,39 +3344,7 @@
114  #endif /* USE_HANDSHAKE */
115             ) {
116             ptyname = ttydev;
117 -           utmp.ut_type = USER_PROCESS;
118 -           if (PTYCHARLEN >= (int)strlen(ptyname))
119 -               ptynameptr = ptyname;
120 -           else
121 -               ptynameptr = ptyname + strlen(ptyname) - PTYCHARLEN;
122 -           (void) strncpy(utmp.ut_id, ptynameptr, sizeof(utmp.ut_id));
123 -           (void) setutent();
124 -           utptr = getutid(&utmp);
125 -           /* write it out only if it exists, and the pid's match */
126 -           if (utptr && (utptr->ut_pid == screen->pid)) {
127 -                   utptr->ut_type = DEAD_PROCESS;
128 -#ifdef SVR4
129 -                   utmp.ut_session = getsid(0);
130 -                   utmp.ut_xtime = time ((Time_t *) 0);
131 -                   utmp.ut_tv.tv_usec = 0;
132 -#else
133 -                   utptr->ut_time = time((Time_t *) 0);
134 -#endif
135 -                   (void) pututline(utptr);
136 -#ifdef WTMP
137 -#ifdef SVR4
138 -                   updwtmpx(WTMPX_FILE, &utmp);
139 -#else
140 -                   /* set wtmp entry if wtmp file exists */
141 -                   if ((fd = open(etc_wtmp, O_WRONLY | O_APPEND)) >= 0) {
142 -                     i = write(fd, utptr, sizeof(utmp));
143 -                     i = close(fd);
144 -                   }
145 -#endif
146 -#endif
147 -
148 -           }
149 -           (void) endutent();
150 +           removeFromUtmp();
151         }
152  #else  /* not USE_SYSV_UTMP */
153         register int wfd;
154 --- kterm-6.2.0/Imakefile.utempter      Fri Jul 12 01:01:04 1996
155 +++ kterm-6.2.0/Imakefile       Fri Mar 26 12:11:35 1999
156 @@ -24,6 +24,8 @@
157           PTYLIB = -lpucc
158  #endif
159  
160 + PTYLIB = -lutempter -lutil
161 +
162   OSMAJORVERSION = OSMajorVersion
163   OSMINORVERSION = OSMinorVersion
164  
This page took 0.338754 seconds and 3 git commands to generate.