ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/ptytty.C
(Generate patch)

Comparing libptytty/src/ptytty.C (file contents):
Revision 1.5 by root, Sat Jan 21 23:35:08 2006 UTC vs.
Revision 1.6 by root, Sun Jan 22 00:04:20 2006 UTC

384 bool login_shell; 384 bool login_shell;
385 int cmd_pid; 385 int cmd_pid;
386 char hostname[512]; // arbitrary, but should be plenty 386 char hostname[512]; // arbitrary, but should be plenty
387}; 387};
388 388
389struct ptytty_proxy : zero_initialized, ptytty 389struct ptytty_proxy : ptytty
390{ 390{
391 ptytty *id; 391 ptytty *id;
392
393 ~ptytty_proxy ()
394 : id(0)
395 {
396 }
392 397
393 ~ptytty_proxy (); 398 ~ptytty_proxy ();
394 399
395 bool get (); 400 bool get ();
396 void login (int cmd_pid, bool login_shell, const char *hostname); 401 void login (int cmd_pid, bool login_shell, const char *hostname);
432 write (sock_fd, &cmd, sizeof (cmd)); 437 write (sock_fd, &cmd, sizeof (cmd));
433} 438}
434 439
435ptytty_proxy::~ptytty_proxy () 440ptytty_proxy::~ptytty_proxy ()
436{ 441{
442 if (id)
443 {
437 command cmd; 444 command cmd;
438 445
439 cmd.type = command::destroy; 446 cmd.type = command::destroy;
440 cmd.id = id; 447 cmd.id = id;
441 448
442 write (sock_fd, &cmd, sizeof (cmd)); 449 write (sock_fd, &cmd, sizeof (cmd));
450 }
443} 451}
444 452
445static 453static
446void serve () 454void serve ()
447{ 455{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines