|
Line
Link Here
|
| 0 |
-- readproctitle.c- Fri Aug 19 10:11:44 2005 |
0 |
++ readproctitle.c Fri Aug 19 10:21:03 2005 |
|
Lines 1-9
Link Here
|
| 1 |
#include <unistd.h> |
1 |
#include <unistd.h> |
| 2 |
#include "error.h" |
2 |
#include "error.h" |
|
|
3 |
#include "sig.h" |
| 4 |
|
| 5 |
static char *buf; |
| 6 |
static void handler_hangup(int dummy) |
| 7 |
{ |
| 8 |
int i = 0; |
| 9 |
while (buf[i]) buf[i++] = '.'; |
| 10 |
} |
| 3 |
|
11 |
|
| 4 |
int main(int argc,char **argv) |
12 |
int main(int argc,char **argv) |
| 5 |
{ |
13 |
{ |
| 6 |
char *buf; |
|
|
| 7 |
unsigned int len; |
14 |
unsigned int len; |
| 8 |
int i; |
15 |
int i; |
| 9 |
char ch; |
16 |
char ch; |
|
Lines 14-19
Link Here
|
| 14 |
while (buf[len]) buf[len++] = '.'; |
21 |
while (buf[len]) buf[len++] = '.'; |
| 15 |
if (len < 5) _exit(100); |
22 |
if (len < 5) _exit(100); |
| 16 |
|
23 |
|
|
|
24 |
sig_catch(sig_hangup, handler_hangup); |
| 17 |
for (;;) |
25 |
for (;;) |
| 18 |
switch(read(0,&ch,1)) { |
26 |
switch(read(0,&ch,1)) { |
| 19 |
case 1: |
27 |
case 1: |