|
|
1.1 ! root 1: #include "stdio.h" ! 2: #include "signal.h" ! 3: struct rec { ! 4: long len; ! 5: struct rec *next; ! 6: char *fname; ! 7: long cnt[1]; ! 8: } *proFptr = (struct rec *)-1; /* end of list marker */ ! 9: profit() ! 10: { int i; ! 11: FILE *fd; ! 12: struct rec *x = proFptr; ! 13: fd = fopen("/etc/net/prof.out", "w"); ! 14: if(fd == NULL) ! 15: fd = fopen("/usr/net/prof.out", "w"); ! 16: while(x != (struct rec *)-1) { ! 17: fprintf(fd, "%s\n", x->fname); ! 18: for(i = 3; i < x->len; i++) ! 19: fprintf(fd, "%d\n", x->cnt[i-3]); ! 20: x = x->next; ! 21: } ! 22: fflush(fd); ! 23: fclose(fd); ! 24: signal(SIGTERM, profit); ! 25: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.