makeargv();
if (makeargv()) { printf("?Too many arguments\n"); continue; }
main(int argc, char *argv[]){	extern int sock_raw, sock;	struct sockaddr_in sin;	struct cmd *c;	sock_raw = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);	if (sock_raw < 0) {		perror("opening raw socket");		exit(1);	}	(void) seteuid(getuid());	(void) setuid(getuid());	openlog("timedc", LOG_ODELAY, LOG_AUTH);	sock = socket(AF_INET, SOCK_DGRAM, 0);	if (sock < 0) {		perror("opening socket");		(void)close(sock_raw);		return (-1);	}	memset(&sin, 0, sizeof sin);	sin.sin_family = AF_INET;	sin.sin_addr.s_addr = INADDR_ANY;	if (bind(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {		fprintf(stderr, "all reserved ports in use\n");		(void)close(sock_raw);		exit(1);	}	if (--argc > 0) {		c = getcmd(*++argv);		if (c == (struct cmd *)-1) {			printf("?Ambiguous command\n");			exit(1);		}		if (c == 0) {			printf("?Invalid command\n");			exit(1);		}		if (c->c_priv && getuid()) {			printf("?Privileged command\n");			exit(1);		}		(*c->c_handler)(argc, argv);		exit(0);	}	fromatty = isatty(fileno(stdin));	(void) signal(SIGINT, sigintr);	for (;;) {		if (gotintr) {			putchar('\n');			gotintr = 0;		}		if (fromatty) {			printf("timedc> ");			(void) fflush(stdout);		}		siginterrupt(SIGINT, 1);		if (fgets(cmdline, sizeof(cmdline), stdin) == NULL) {			if (errno == EINTR && gotintr) {				siginterrupt(SIGINT, 0);				continue;			}			quit(0, NULL);		}		siginterrupt(SIGINT, 0);		if (cmdline[0] == 0)			break;		makeargv();		if (margv[0] == 0)			continue;		c = getcmd(margv[0]);		if (c == (struct cmd *)-1) {			printf("?Ambiguous command\n");			continue;		}		if (c == 0) {			printf("?Invalid command\n");			continue;		}		if (c->c_priv && getuid()) {			printf("?Privileged command\n");			continue;		}		(*c->c_handler)(margc, margv);	}	return 0;}