| Summary: | top(1) races when it loses its terminal | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Peter Avalos <peter> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Peter Avalos
2001-09-15 01:40:00 UTC
A fix for this is this. I've forward this to the author of top
also, can please somebody in the mean time submit this to the
FreeBSD source?
--- /usr/src/contrib/top/top.c.old Fri Oct 12 16:13:52 2001
+++ /usr/src/contrib/top/top.c Fri Oct 12 16:16:44 2001
@@ -721,7 +721,11 @@
/* now read it and convert to command strchr */
/* (use "change" as a temporary to hold strchr) */
- (void) read(0, &ch, 1);
+ if (read(0, &ch, 1)==0) {
+ /* this happens if the controlling terminal */
+ /* has disappeared. Maybe due to network problems? */
+ quit(0);
+ }
if ((iptr = strchr(command_chars, ch)) == NULL)
{
if (ch != '\r' && ch != '\n')
--
Edwin Groothuis | Personal website: http://www.MavEtJu.org
edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions:
------------------+ http://www.FatalDimensions.org/
State Changed From-To: open->closed I'm abou to commit the patch in PR 30939, which is similar to Edwin's patch in this PR. |