Removed a whole herd of unused variables.
Some other cleanup.
This commit is contained in:
parent
9d247900c0
commit
5459f3a607
@ -38,7 +38,6 @@ PUBLIC int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
message m;
|
message m;
|
||||||
int result;
|
int result;
|
||||||
sigset_t sigset;
|
|
||||||
|
|
||||||
/* SEF local startup. */
|
/* SEF local startup. */
|
||||||
env_setargs(argc, argv);
|
env_setargs(argc, argv);
|
||||||
@ -118,7 +117,6 @@ PRIVATE void sig_handler()
|
|||||||
{
|
{
|
||||||
/* Signal handler. */
|
/* Signal handler. */
|
||||||
sigset_t sigset;
|
sigset_t sigset;
|
||||||
int sig;
|
|
||||||
|
|
||||||
/* Try to obtain signal set from PM. */
|
/* Try to obtain signal set from PM. */
|
||||||
if (getsigset(&sigset) != 0) return;
|
if (getsigset(&sigset) != 0) return;
|
||||||
|
@ -262,7 +262,6 @@ message *m_ptr; /* request message */
|
|||||||
* created or updated) matching that subscription. Return
|
* created or updated) matching that subscription. Return
|
||||||
* a message and copy the key and value for every one.
|
* a message and copy the key and value for every one.
|
||||||
*/
|
*/
|
||||||
struct data_store *dsp;
|
|
||||||
int r, s, d, type = m_ptr->DS_FLAGS & DS_TYPE_MASK;
|
int r, s, d, type = m_ptr->DS_FLAGS & DS_TYPE_MASK;
|
||||||
if(!type) return EINVAL;
|
if(!type) return EINVAL;
|
||||||
for(s = 0; s < NR_DS_SUBS; s++) {
|
for(s = 0; s < NR_DS_SUBS; s++) {
|
||||||
|
@ -4,8 +4,6 @@ This file contains routines for buffer management.
|
|||||||
Copyright 1995 Philip Homburg
|
Copyright 1995 Philip Homburg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BUF_IMPLEMENTATION 1 /* Avoid some macros */
|
|
||||||
|
|
||||||
#include "inet.h"
|
#include "inet.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -13,7 +11,6 @@ Copyright 1995 Philip Homburg
|
|||||||
|
|
||||||
#include "generic/assert.h"
|
#include "generic/assert.h"
|
||||||
#include "generic/buf.h"
|
#include "generic/buf.h"
|
||||||
#include "generic/type.h"
|
|
||||||
|
|
||||||
THIS_FILE
|
THIS_FILE
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ Copyright 1995 Philip Homburg
|
|||||||
#include "generic/assert.h"
|
#include "generic/assert.h"
|
||||||
#include "generic/buf.h"
|
#include "generic/buf.h"
|
||||||
#include "generic/clock.h"
|
#include "generic/clock.h"
|
||||||
#include "generic/type.h"
|
|
||||||
|
|
||||||
THIS_FILE
|
THIS_FILE
|
||||||
|
|
||||||
@ -25,8 +24,6 @@ FORWARD _PROTOTYPE( void set_timer, (void) );
|
|||||||
|
|
||||||
PUBLIC void clck_init()
|
PUBLIC void clck_init()
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
|
|
||||||
clck_call_expire= 0;
|
clck_call_expire= 0;
|
||||||
curr_time= 0;
|
curr_time= 0;
|
||||||
prev_time= 0;
|
prev_time= 0;
|
||||||
@ -38,8 +35,7 @@ PUBLIC time_t get_time()
|
|||||||
{
|
{
|
||||||
if (!curr_time)
|
if (!curr_time)
|
||||||
{
|
{
|
||||||
int s;
|
if (getuptime(&curr_time) != OK)
|
||||||
if ((s=getuptime(&curr_time)) != OK)
|
|
||||||
ip_panic(("can't read clock"));
|
ip_panic(("can't read clock"));
|
||||||
assert(curr_time >= prev_time);
|
assert(curr_time >= prev_time);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ Copyright 1995 Philip Homburg
|
|||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "eth.h"
|
#include "eth.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "sr.h"
|
|
||||||
|
|
||||||
THIS_FILE
|
THIS_FILE
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ Copyright 1995 Philip Homburg
|
|||||||
#include "buf.h"
|
#include "buf.h"
|
||||||
#include "eth.h"
|
#include "eth.h"
|
||||||
#include "eth_int.h"
|
#include "eth_int.h"
|
||||||
#include "io.h"
|
|
||||||
#include "sr.h"
|
#include "sr.h"
|
||||||
|
|
||||||
THIS_FILE
|
THIS_FILE
|
||||||
@ -742,10 +741,8 @@ eth_fd_t *eth_fd;
|
|||||||
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned int en_di_flags;
|
unsigned int en_di_flags;
|
||||||
eth_port_t *eth_port;
|
|
||||||
acc_t *pack;
|
acc_t *pack;
|
||||||
|
|
||||||
eth_port= eth_fd->ef_port;
|
|
||||||
flags= eth_fd->ef_ethopt.nweo_flags;
|
flags= eth_fd->ef_ethopt.nweo_flags;
|
||||||
en_di_flags= (flags >>16) | (flags & 0xffff);
|
en_di_flags= (flags >>16) | (flags & 0xffff);
|
||||||
|
|
||||||
|
@ -672,7 +672,6 @@ acc_t *reply_ip_hdr;
|
|||||||
if (r == -1)
|
if (r == -1)
|
||||||
{
|
{
|
||||||
bf_afree(reply_ip_hdr);
|
bf_afree(reply_ip_hdr);
|
||||||
reply_ip_hdr= NULL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1118,7 +1117,7 @@ icmp_hdr_t **icmp_hdr_pp;
|
|||||||
acc_t *ip_pack, *icmp_pack, *tmp_pack;
|
acc_t *ip_pack, *icmp_pack, *tmp_pack;
|
||||||
int ip_hdr_len, icmp_hdr_len, ih_type;
|
int ip_hdr_len, icmp_hdr_len, ih_type;
|
||||||
size_t size, pack_len;
|
size_t size, pack_len;
|
||||||
ipaddr_t dest, netmask;
|
ipaddr_t dest;
|
||||||
nettype_t nettype;
|
nettype_t nettype;
|
||||||
|
|
||||||
pack= bf_packIffLess(pack, IP_MIN_HDR_SIZE);
|
pack= bf_packIffLess(pack, IP_MIN_HDR_SIZE);
|
||||||
@ -1163,7 +1162,6 @@ icmp_hdr_t **icmp_hdr_pp;
|
|||||||
}
|
}
|
||||||
dest= ip_hdr->ih_src;
|
dest= ip_hdr->ih_src;
|
||||||
nettype= ip_nettype(dest);
|
nettype= ip_nettype(dest);
|
||||||
netmask= ip_netmask(nettype);
|
|
||||||
if (nettype != IPNT_CLASS_A && nettype != IPNT_LOCAL &&
|
if (nettype != IPNT_CLASS_A && nettype != IPNT_LOCAL &&
|
||||||
nettype != IPNT_CLASS_B && nettype != IPNT_CLASS_C)
|
nettype != IPNT_CLASS_B && nettype != IPNT_CLASS_C)
|
||||||
{
|
{
|
||||||
|
@ -387,7 +387,6 @@ int priority;
|
|||||||
{
|
{
|
||||||
for (i= 0, ip_ass= ip_ass_table; i<IP_ASS_NR; i++, ip_ass++)
|
for (i= 0, ip_ass= ip_ass_table; i<IP_ASS_NR; i++, ip_ass++)
|
||||||
{
|
{
|
||||||
next_pack= ip_ass->ia_frags;
|
|
||||||
while(ip_ass->ia_frags != NULL)
|
while(ip_ass->ia_frags != NULL)
|
||||||
{
|
{
|
||||||
pack= ip_ass->ia_frags;
|
pack= ip_ass->ia_frags;
|
||||||
|
@ -272,7 +272,7 @@ int type;
|
|||||||
size_t pack_size;
|
size_t pack_size;
|
||||||
eth_hdr_t *eth_hdr;
|
eth_hdr_t *eth_hdr;
|
||||||
xmit_hdr_t *xmit_hdr;
|
xmit_hdr_t *xmit_hdr;
|
||||||
ipaddr_t hostpart, tmpaddr;
|
ipaddr_t tmpaddr;
|
||||||
time_t t;
|
time_t t;
|
||||||
u32_t *p;
|
u32_t *p;
|
||||||
|
|
||||||
@ -321,7 +321,6 @@ int type;
|
|||||||
ip_panic(( "invalid destination" ));
|
ip_panic(( "invalid destination" ));
|
||||||
}
|
}
|
||||||
|
|
||||||
hostpart= (dest & ~ip_port->ip_subnetmask);
|
|
||||||
assert(dest != ip_port->ip_ipaddr);
|
assert(dest != ip_port->ip_ipaddr);
|
||||||
|
|
||||||
r= arp_ip_eth(ip_port->ip_dl.dl_eth.de_port,
|
r= arp_ip_eth(ip_port->ip_dl.dl_eth.de_port,
|
||||||
|
@ -504,7 +504,7 @@ PUBLIC int ip_setconf(ip_port_nr, ipconf)
|
|||||||
int ip_port_nr;
|
int ip_port_nr;
|
||||||
nwio_ipconf_t *ipconf;
|
nwio_ipconf_t *ipconf;
|
||||||
{
|
{
|
||||||
int i, old_ip_flags, do_report;
|
int i, do_report;
|
||||||
ip_port_t *ip_port;
|
ip_port_t *ip_port;
|
||||||
ip_fd_t *ip_fd;
|
ip_fd_t *ip_fd;
|
||||||
ipaddr_t ipaddr;
|
ipaddr_t ipaddr;
|
||||||
@ -512,8 +512,6 @@ nwio_ipconf_t *ipconf;
|
|||||||
|
|
||||||
ip_port= &ip_port_table[ip_port_nr];
|
ip_port= &ip_port_table[ip_port_nr];
|
||||||
|
|
||||||
old_ip_flags= ip_port->ip_flags;
|
|
||||||
|
|
||||||
if (ipconf->nwic_flags & ~NWIC_FLAGS)
|
if (ipconf->nwic_flags & ~NWIC_FLAGS)
|
||||||
return EBADMODE;
|
return EBADMODE;
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@ Copyright 1995 Philip Homburg
|
|||||||
|
|
||||||
THIS_FILE
|
THIS_FILE
|
||||||
|
|
||||||
#define NOT_IMPLEMENTED 0
|
|
||||||
|
|
||||||
PUBLIC tcp_port_t *tcp_port_table;
|
PUBLIC tcp_port_t *tcp_port_table;
|
||||||
PUBLIC tcp_fd_t tcp_fd_table[TCP_FD_NR];
|
PUBLIC tcp_fd_t tcp_fd_table[TCP_FD_NR];
|
||||||
PUBLIC tcp_conn_t tcp_conn_table[TCP_CONN_NR];
|
PUBLIC tcp_conn_t tcp_conn_table[TCP_CONN_NR];
|
||||||
|
@ -47,7 +47,6 @@ from DL_ETH:
|
|||||||
#define _MINIX_SOURCE 1
|
#define _MINIX_SOURCE 1
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <time.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/svrctl.h>
|
#include <sys/svrctl.h>
|
||||||
#include <minix/ds.h>
|
#include <minix/ds.h>
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <minix3/queryparam.h>
|
#include <minix3/queryparam.h>
|
||||||
|
|
||||||
#if EXAMPLE
|
#if EXAMPLE
|
||||||
|
@ -219,12 +219,6 @@ PUBLIC void eth_write_port(eth_port, pack)
|
|||||||
eth_port_t *eth_port;
|
eth_port_t *eth_port;
|
||||||
acc_t *pack;
|
acc_t *pack;
|
||||||
{
|
{
|
||||||
eth_port_t *loc_port;
|
|
||||||
message mess1, block_msg;
|
|
||||||
u8_t *eth_dst_ptr;
|
|
||||||
int multicast, r;
|
|
||||||
ev_arg_t ev_arg;
|
|
||||||
|
|
||||||
assert(!no_ethWritePort);
|
assert(!no_ethWritePort);
|
||||||
assert(!eth_port->etp_vlan);
|
assert(!eth_port->etp_vlan);
|
||||||
|
|
||||||
@ -245,8 +239,7 @@ acc_t *pack;
|
|||||||
PRIVATE int notification_count;
|
PRIVATE int notification_count;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PUBLIC void eth_rec(m)
|
PUBLIC void eth_rec(message *m)
|
||||||
message *m;
|
|
||||||
{
|
{
|
||||||
int i, r, m_type, stat;
|
int i, r, m_type, stat;
|
||||||
eth_port_t *loc_port, *vlan_port;
|
eth_port_t *loc_port, *vlan_port;
|
||||||
@ -487,10 +480,9 @@ message *m;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC void eth_check_drivers(m)
|
PUBLIC void eth_check_drivers(message *m)
|
||||||
message *m;
|
|
||||||
{
|
{
|
||||||
int i, r, tasknr;
|
int r, tasknr;
|
||||||
|
|
||||||
tasknr= m->m_source;
|
tasknr= m->m_source;
|
||||||
#if 0
|
#if 0
|
||||||
@ -516,7 +508,6 @@ PUBLIC int eth_get_stat(eth_port, eth_stat)
|
|||||||
eth_port_t *eth_port;
|
eth_port_t *eth_port;
|
||||||
eth_stat_t *eth_stat;
|
eth_stat_t *eth_stat;
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
cp_grant_id_t gid;
|
cp_grant_id_t gid;
|
||||||
|
|
||||||
assert(!eth_port->etp_vlan);
|
assert(!eth_port->etp_vlan);
|
||||||
@ -552,7 +543,7 @@ u32_t flags;
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
unsigned dl_flags, mask;
|
unsigned dl_flags, mask;
|
||||||
message mess, repl_mess;
|
message mess;
|
||||||
|
|
||||||
assert(!eth_port->etp_vlan);
|
assert(!eth_port->etp_vlan);
|
||||||
|
|
||||||
@ -764,11 +755,9 @@ int count;
|
|||||||
PRIVATE void setup_read(eth_port)
|
PRIVATE void setup_read(eth_port)
|
||||||
eth_port_t *eth_port;
|
eth_port_t *eth_port;
|
||||||
{
|
{
|
||||||
eth_port_t *loc_port;
|
|
||||||
acc_t *pack, *pack_ptr;
|
acc_t *pack, *pack_ptr;
|
||||||
message mess1, block_msg;
|
message mess1;
|
||||||
iovec_s_t *iovec;
|
iovec_s_t *iovec;
|
||||||
ev_arg_t ev_arg;
|
|
||||||
int i, r;
|
int i, r;
|
||||||
|
|
||||||
assert(!eth_port->etp_vlan);
|
assert(!eth_port->etp_vlan);
|
||||||
@ -908,7 +897,7 @@ static void eth_restart(eth_port, tasknr)
|
|||||||
eth_port_t *eth_port;
|
eth_port_t *eth_port;
|
||||||
int tasknr;
|
int tasknr;
|
||||||
{
|
{
|
||||||
int i, r;
|
int r;
|
||||||
unsigned flags, dl_flags;
|
unsigned flags, dl_flags;
|
||||||
cp_grant_id_t gid;
|
cp_grant_id_t gid;
|
||||||
message mess;
|
message mess;
|
||||||
|
@ -157,8 +157,7 @@ PRIVATE int qp_read(fd, count)
|
|||||||
int fd;
|
int fd;
|
||||||
size_t count;
|
size_t count;
|
||||||
{
|
{
|
||||||
int r, err;
|
int r;
|
||||||
size_t len;
|
|
||||||
acc_t *pkt;
|
acc_t *pkt;
|
||||||
qp_fd_t *qp_fd;
|
qp_fd_t *qp_fd;
|
||||||
|
|
||||||
@ -329,7 +328,7 @@ int c;
|
|||||||
/* Send one character back to the user. */
|
/* Send one character back to the user. */
|
||||||
acc_t *pkt;
|
acc_t *pkt;
|
||||||
qp_fd_t *qp_fd;
|
qp_fd_t *qp_fd;
|
||||||
size_t n, bytes_left;
|
size_t bytes_left;
|
||||||
off_t off;
|
off_t off;
|
||||||
|
|
||||||
bytes_left= qv->rd_bytes_left;
|
bytes_left= qv->rd_bytes_left;
|
||||||
|
@ -459,12 +459,11 @@ message *m;
|
|||||||
{
|
{
|
||||||
sr_fd_t *sr_fd;
|
sr_fd_t *sr_fd;
|
||||||
int result;
|
int result;
|
||||||
int proc_nr, ref, operation;
|
int proc_nr, ref;
|
||||||
|
|
||||||
result=EINTR;
|
result=EINTR;
|
||||||
proc_nr= m->IO_ENDPT;
|
proc_nr= m->IO_ENDPT;
|
||||||
ref= (int)m->IO_GRANT;
|
ref= (int)m->IO_GRANT;
|
||||||
operation= 0;
|
|
||||||
sr_fd= sr_getchannel(m->DEVICE);
|
sr_fd= sr_getchannel(m->DEVICE);
|
||||||
assert (sr_fd);
|
assert (sr_fd);
|
||||||
|
|
||||||
@ -496,12 +495,8 @@ PRIVATE int sr_select(m)
|
|||||||
message *m;
|
message *m;
|
||||||
{
|
{
|
||||||
sr_fd_t *sr_fd;
|
sr_fd_t *sr_fd;
|
||||||
mq_t **q_head_ptr, **q_tail_ptr;
|
int r;
|
||||||
int ip_flag, susp_flag;
|
|
||||||
int r, ops;
|
|
||||||
unsigned m_ops, i_ops;
|
unsigned m_ops, i_ops;
|
||||||
ioreq_t request;
|
|
||||||
size_t size;
|
|
||||||
|
|
||||||
sr_fd= sr_getchannel(m->DEVICE);
|
sr_fd= sr_getchannel(m->DEVICE);
|
||||||
assert (sr_fd);
|
assert (sr_fd);
|
||||||
@ -651,12 +646,11 @@ mq_t *mq;
|
|||||||
int status;
|
int status;
|
||||||
int is_revive;
|
int is_revive;
|
||||||
{
|
{
|
||||||
int result, proc, ref,operation;
|
int result, proc, ref;
|
||||||
message reply, *mp;
|
message reply, *mp;
|
||||||
|
|
||||||
proc= mq->mq_mess.IO_ENDPT;
|
proc= mq->mq_mess.IO_ENDPT;
|
||||||
ref= (int)mq->mq_mess.IO_GRANT;
|
ref= (int)mq->mq_mess.IO_GRANT;
|
||||||
operation= mq->mq_mess.m_type;
|
|
||||||
|
|
||||||
if (is_revive)
|
if (is_revive)
|
||||||
mp= &mq->mq_mess;
|
mp= &mq->mq_mess;
|
||||||
|
@ -209,7 +209,7 @@ void onterm(int sig)
|
|||||||
|
|
||||||
void onabrt(int sig)
|
void onabrt(int sig)
|
||||||
{
|
{
|
||||||
static int count;
|
static int count = 0;
|
||||||
|
|
||||||
if (++count == 2) reboot(RBT_HALT);
|
if (++count == 2) reboot(RBT_HALT);
|
||||||
gotabrt = 1;
|
gotabrt = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user