🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

4 total messages Started by Phil Hochstetler Tue, 06 Jun 1989 03:56
Typo in top 2.5
#165
Author: Phil Hochstetler
Date: Tue, 06 Jun 1989 03:56
16 lines
856 bytes
I noticed a typo in top 2.5 in the file "display.c".
The following code has an extra ";" at line 117.

   117	    if (mpid != lmpid);
   118	    {
   119		Move_to(x_lastpid, y_lastpid);
   120		printf("%5d", mpid);
   121		lmpid = mpid;
   122	    }

This bug is somewhat harmless but does increase the cpu time consumed.

-- 
Phil Hochstetler		UUCP:  uunet!sequent!phil
Sequent Computer Systems
Beaverton, Oregon
Re: Typo in top 2.5
#166
Author: richard.r.grady..jr
Date: Tue, 06 Jun 1989 21:35
20 lines
1222 bytes
In article <16964@sequent.UUCP> phil@sequent.UUCP (Phil Hochstetler) writes:
- I noticed a typo in top 2.5 in the file "display.c".
- The following code has an extra ";" at line 117.
- 
-    117	    if (mpid != lmpid);
-    118	    {
-    119		Move_to(x_lastpid, y_lastpid);
-    120		printf("%5d", mpid);
-    121		lmpid = mpid;
-    122	    }
- 
- This bug is somewhat harmless but does increase the cpu time consumed.

The ";" at the end of line 117 terminates the "if" statement.
Thus lines 119-121 are ALWAYS executed,
probably not what the programmer of top 2.5 intended.
This doesn't seem to me to be a harmless bug!

-------------------------------------------------------------------
Dick Grady               r4@mvuxd.att.com          ...!att!mvuxd!r4 
Re: Typo in top 2.5
#167
Author: Rick Adams
Date: Wed, 07 Jun 1989 04:23
12 lines
885 bytes
If you actually look at the code you will see that on most
real systems it makes absolutely no difference!

The test is to see if the maximum pid hsa increased since the
last window update.

Given that the window updates are on the over of several seconds,
if your system hasn't created a new process in that time
period, then its idle anyway, so who cares?

yes, its clearly a bug, but its not a big deal.
Re: Typo in top 2.5
#168
Author: Tony Ivanov
Date: Wed, 07 Jun 1989 16:13
30 lines
1813 bytes
In article <7189@cbnews.ATT.COM> r4@cbnews.ATT.COM (richard.r.grady..jr) writes:
^In article <16964@sequent.UUCP> phil@sequent.UUCP (Phil Hochstetler) writes:
^- I noticed a typo in top 2.5 in the file "display.c".
^- The following code has an extra ";" at line 117.
^- 
^-    117	    if (mpid != lmpid);
^-    118	    {
^-    119		Move_to(x_lastpid, y_lastpid);
^-    120		printf("%5d", mpid);
^-    121		lmpid = mpid;
^-    122	    }
^- 
^- This bug is somewhat harmless but does increase the cpu time consumed.
^
^The ";" at the end of line 117 terminates the "if" statement.
^Thus lines 119-121 are ALWAYS executed,
^probably not what the programmer of top 2.5 intended.
^This doesn't seem to me to be a harmless bug!

Look at what the code does: moves to the correct location on the screen, then
prints out the "mpid" variable, then sets lmpid to mpid.  Even if mpid is the
same as lmpid, the output result is the same.  Seems pretty harmless to me!

				--Tony

-- 
/* My opinions...             *  Tony Ivanov   MS-4B       *  ...ucbvax!   */
/* shared by my company?!...  *  Grass Valley Group, Inc.  *  tektronix!   */
/* you've got to be kidding!  *  P.O. Box 1114             *  gvgpsa!      */
/* "tony@gvgpvd.GVG.TEK.COM"  *  Grass Valley, CA  95945   *  gvgpvd!tony  */
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads