[comp.mail.mush] mushview...

dor@lanl.gov (David Rich) (07/31/89)

I stumbled across an apparent bug in the beta release of mushview
and I thought I'd go ahead and post the mail I sent off to rburridge.
Here goes...

}
}From drich Sun Jul 30 17:43:38 1989
}From: drich@knight (David O. Rich)
}Date: Sun, 30 Jul 89 17:43:38 MDT
}X-Mailer: Mail User's Shell (6.5.6 6/30/89)
}To: rburridge@sun.com
}Subject: mushview (more info)...
}Status: OR
}
}[In The Message Entitled: "mushview..." (Dated Jul 28,  3:46pm),
} TO: rburridge@sun.com:]
} > 
} > I just fired up mushview on my 3/60 running
} > SunOS 4.0.3 and it appears that mushview doesn't
} > respond to "new" mail.  The icon does not change
} > when new mail arrives, and new mail only registers
} > in the message panel when I change folders.  So,
} > to see if I have new mail, I have to open mushview
} > from the icon and do a change folder to the system
} > folder.  Is there a flag or something I need to set
} > to get mushview to respond to new mail?
} > 
} > Thanks.
} > 
} > --Dave Rich (dor@lanl.gov)
} > 
}[End Included Message.]
}
}Well, I've toyed around a bit, and I've got some more information
}for you.  It turns out that the above is not exactly true.  When
}mushtool is first fired up (fresh), the very first incoming message
}triggers an icon change (if iconic) or a new mail message (if not
}iconic).  After that first message, mushtool does not respond to
}new messages.  So, I dug into the source and found where the notify
}timer is set (in main.c).  After looking at some Sun documentation,
}it turns out the following (1 line) seems to fix the problem:
}
}...[excerpt from main.c]
}
}        timerclear(&(mail_timer.it_interval));
}        timerclear(&(mail_timer.it_value));
}
}        /* reload timer w/value of time_out upon timer expiration [dor] */
}==>        mail_timer.it_interval.tv_sec = time_out;
}        /*                                                        [dor] */
}
}        mail_timer.it_value.tv_sec = time_out;
}        (void) notify_set_itimer_func(tool, do_check,
}            ITIMER_REAL, &mail_timer, (struct itimerval *) 0);
}
}I think what I've done is tell the timer to restart itself once it expires.
}The old mush code used to do this "manually" by calling setitimer (this call
}was in signals.c -- in the check_new_mail code).
}
}Also, I made a similar change in msgs.c -- I replaced the call to setitimer
}with a call to notify_set_itimer_func (as above) and added my 1 line fix as
}well.
}
}I don't really know if I managed to track down the "real" problem or not, but
}the fixes I applied seem to work.
}
}Sorry about the initial vague message ;-).
}
}--Dave

--Dave