3 sub fault ($) { print STDERR "$_[0]\n"; exit 8; }
5 @ARGV==5 or fault("invalid arguments to $0");
6 ($line,$idlesince,$nick,$path,$chan) = @ARGV;
8 open X, ">&0" or fault("reopen stdin for output: $!");
10 $timestring= localtime time;
13 pline("You are cordially invited onto the system's IRC server by \`$nick'");
14 pline("($path) at $timestring");
15 pline("If you don't know how to use IRC, run \`irc <your-nickname> chiark'");
16 pline("When you are on-line, please ".
17 (length $chan ? "join $chan." : "send a private note to $nick."));
22 print "ok $line $idlesince\n";
27 print X "\r", " "x78, "\r $s\r\n" or outfail();
31 if ($! == &EAGAIN || $! == &EWOULDBLOCK) {
32 print "failed has a congested terminal\n";
35 print "failed has a broken terminal ($!)\n";