* Variables definition
*/
int list_fd, conn_fd;
- int waiting = 0;
int compat = 0;
int reroot = 0;
char * rootdir;
case 'd':
debugging = 1;
break;
- case 'w':
- waiting = strtol(optarg, NULL, 10);
- break;
case 'r':
- printf("chroot\n");
reroot = 1;
rootdir = optarg;
break;
}
/* chroot if requested */
if (reroot) {
- printf("chroot to %s\n", rootdir);
if (chdir(rootdir)) {
perror("Cannot find directory to chroot");
exit(1);
PrintErr("listen error");
exit(1);
}
- if (waiting) sleep(waiting);
/* handle echo to client */
while (1) {
/* accept connection */