PM: a few Coverity inspired fixes

.initialize variable to prevent negative array indexing
.remove dead code
This commit is contained in:
Thomas Veerman 2012-07-26 15:18:21 +00:00
parent ca085c16ef
commit 238a9a057b
2 changed files with 4 additions and 11 deletions

View file

@ -47,7 +47,7 @@ int do_fork()
register struct mproc *rmp; /* pointer to parent */
register struct mproc *rmc; /* pointer to child */
pid_t new_pid;
static int next_child;
static int next_child = 0;
int i, n = 0, s;
endpoint_t child_ep;
message m;
@ -146,7 +146,7 @@ int do_srv_fork()
register struct mproc *rmc; /* pointer to child */
int s;
pid_t new_pid;
static int next_child;
static int next_child = 0;
int i, n = 0;
endpoint_t child_ep;
message m;

View file

@ -90,18 +90,11 @@ int main()
/* Check for system notifications first. Special cases. */
if (is_ipc_notify(ipc_status)) {
switch(who_p) {
case CLOCK:
expire_timers(m_in.NOTIFY_TIMESTAMP);
result = SUSPEND; /* don't reply */
break;
default :
/* ignore notify() from unknown sender */
result = SUSPEND;
if (who_p == CLOCK) {
expire_timers(m_in.NOTIFY_TIMESTAMP);
}
/* done, send reply and continue */
if (result != SUSPEND) setreply(who_p, result);
sendreply();
continue;
}