ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/logging.C
(Generate patch)

Comparing rxvt-unicode/src/logging.C (file contents):
Revision 1.30 by root, Tue Jan 17 11:02:10 2006 UTC vs.
Revision 1.35 by root, Sun Jan 22 00:36:59 2006 UTC

163 endutxent (); /* close the file */ 163 endutxent (); /* close the file */
164 utmp_pos = 0; 164 utmp_pos = 0;
165#endif 165#endif
166 166
167#if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID) 167#if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID)
168
169 { 168 {
170# ifdef HAVE_TTYSLOT 169# ifdef HAVE_TTYSLOT
170 int fdstdin = dup (STDIN_FILENO);
171 dup2 (tty, STDIN_FILENO);
172
171 i = ttyslot (); 173 i = ttyslot ();
172 if (rxvt_write_bsd_utmp (i, ut)) 174 if (rxvt_write_bsd_utmp (i, ut))
173 utmp_pos = i; 175 utmp_pos = i;
176
177 dup2 (fdstdin, STDIN_FILENO);
178 close (fdstdin);
174# else 179# else
175 FILE *fd0; 180 FILE *fd0;
176 181
177 if ((fd0 = fopen (TTYTAB_FILENAME, "r")) != NULL) 182 if ((fd0 = fopen (TTYTAB_FILENAME, "r")) != NULL)
178 { 183 {
179 char buf[256], name[256]; 184 char buf[256], name[256];
180 185
198# endif 203# endif
199 } 204 }
200#endif 205#endif
201 206
202#ifdef WTMP_SUPPORT 207#ifdef WTMP_SUPPORT
203# ifdef WTMP_ONLY_ON_LOGIN 208#ifdef LOG_ONLY_ON_LOGIN
204 if (login_shell) 209 if (login_shell)
205# endif 210#endif
206 { 211 {
207# ifdef HAVE_STRUCT_UTMP 212# ifdef HAVE_STRUCT_UTMP
208# ifdef HAVE_UPDWTMP 213# ifdef HAVE_UPDWTMP
209 updwtmp (RXVT_WTMP_FILE, ut); 214 updwtmp (RXVT_WTMP_FILE, ut);
210# else 215# else
215 updwtmpx (RXVT_WTMPX_FILE, utx); 220 updwtmpx (RXVT_WTMPX_FILE, utx);
216# endif 221# endif
217 } 222 }
218#endif 223#endif
219#if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE) 224#if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE)
225#ifdef LOG_ONLY_ON_LOGIN
220 if (login_shell) 226 if (login_shell)
227#endif
221 rxvt_update_lastlog (RXVT_LASTLOG_FILE, pty, hostname); 228 rxvt_update_lastlog (RXVT_LASTLOG_FILE, pty, hostname);
222#endif 229#endif
223} 230}
224 231
225/* ------------------------------------------------------------------------- */ 232/* ------------------------------------------------------------------------- */
274 281
275 /* 282 /*
276 * Write ending wtmp entry 283 * Write ending wtmp entry
277 */ 284 */
278#ifdef WTMP_SUPPORT 285#ifdef WTMP_SUPPORT
279# ifdef WTMP_ONLY_ON_LOGIN 286#ifdef LOG_ONLY_ON_LOGIN
280 if (login_shell) 287 if (login_shell)
281# endif 288#endif
282 { 289 {
283# ifdef HAVE_STRUCT_UTMP 290# ifdef HAVE_STRUCT_UTMP
284# ifdef HAVE_UPDWTMP 291# ifdef HAVE_UPDWTMP
285 updwtmp (RXVT_WTMP_FILE, ut); 292 updwtmp (RXVT_WTMP_FILE, ut);
286# else 293# else
440# endif /* HAVE_STRUCT_LASTLOG */ 447# endif /* HAVE_STRUCT_LASTLOG */
441} 448}
442#endif /* LASTLOG_SUPPORT */ 449#endif /* LASTLOG_SUPPORT */
443/* ------------------------------------------------------------------------- */ 450/* ------------------------------------------------------------------------- */
444 451
452#else
453void
454rxvt_ptytty_unix::login (int cmd_pid, bool login_shell, const char *hostname)
455{
456}
445#endif /* UTMP_SUPPORT */ 457#endif /* UTMP_SUPPORT */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines