- Pass pointer to fd_set in ReadSockets.

- style(9) nits.

Submitted by:	ru
This commit is contained in:
Gleb Smirnoff 2006-08-08 07:04:40 +00:00
parent ab83ac429d
commit eac2afced2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161071

View File

@ -68,7 +68,7 @@
/* Internal functions */ /* Internal functions */
static int ReadFile(FILE *fp); static int ReadFile(FILE *fp);
static void ReadSockets(fd_set); static void ReadSockets(fd_set *);
static int DoParseCommand(char *line); static int DoParseCommand(char *line);
static int DoCommand(int ac, char **av); static int DoCommand(int ac, char **av);
static int DoInteractive(void); static int DoInteractive(void);
@ -227,6 +227,7 @@ ReadFile(FILE *fp)
static void static void
Unblock(int signal) Unblock(int signal)
{ {
unblock = 1; unblock = 1;
} }
@ -262,8 +263,7 @@ Monitor(void *v)
} }
err(EX_OSERR, "select"); err(EX_OSERR, "select");
} }
ReadSockets(&rfds);
ReadSockets(rfds);
} }
return (NULL); return (NULL);
@ -272,7 +272,8 @@ Monitor(void *v)
static char * static char *
Prompt(EditLine *el) Prompt(EditLine *el)
{ {
return PROMPT;
return (PROMPT);
} }
/* /*
@ -371,7 +372,7 @@ DoInteractive(void)
printf("\n"); printf("\n");
} }
ReadSockets(rfds); ReadSockets(&rfds);
/* Get any user input */ /* Get any user input */
if (FD_ISSET(0, &rfds)) { if (FD_ISSET(0, &rfds)) {
@ -393,14 +394,14 @@ DoInteractive(void)
* Read and process data on netgraph control and data sockets. * Read and process data on netgraph control and data sockets.
*/ */
static void static void
ReadSockets(fd_set rfds) ReadSockets(fd_set *rfds)
{ {
/* Display any incoming control message. */ /* Display any incoming control message. */
if (FD_ISSET(csock, &rfds)) if (FD_ISSET(csock, rfds))
MsgRead(); MsgRead();
/* Display any incoming data packet. */ /* Display any incoming data packet. */
if (FD_ISSET(dsock, &rfds)) { if (FD_ISSET(dsock, rfds)) {
char hook[NG_HOOKSIZ]; char hook[NG_HOOKSIZ];
u_char *buf; u_char *buf;
int rl; int rl;