| 1 | #include <sys/param.h> |
| 2 | #include <sys/ino.h> |
| 3 | #include <dumprestor.h> |
| 4 | |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | main() |
| 8 | { |
| 9 | struct idates idt; |
| 10 | char response[100]; |
| 11 | FILE *tty; |
| 12 | |
| 13 | if (freopen("/etc/ddate", "r", stdin) < 0) |
| 14 | perror("/etc/ddate"), exit(1); |
| 15 | tty = fopen("/dev/tty", "r"); |
| 16 | while (fread(&idt, sizeof idt, 1, stdin) == 1) { |
| 17 | fprintf(stderr,"%.8s %c %25.25s ? ", idt.id_name, idt.id_incno, |
| 18 | ctime(&idt.id_ddate)); |
| 19 | fgets(response,100,tty); |
| 20 | /* |
| 21 | if (!strcmp(idt.id_name,"rrp0g")) |
| 22 | strcpy(idt.id_name,"rrp2h"); |
| 23 | */ |
| 24 | if (response[0] == 'y') |
| 25 | fwrite(&idt, sizeof idt, 1, stdout); |
| 26 | } |
| 27 | } |