Page MenuHomeFreeBSD

top(1): Fix the prompt bug and core dump problem in o / p mode that occurred by r336028
ClosedPublic

Authored by daichi on Jul 8 2018, 12:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 24, 9:12 PM
Unknown Object (File)
May 13 2024, 5:23 AM
Unknown Object (File)
May 13 2024, 5:22 AM
Unknown Object (File)
May 12 2024, 8:48 PM
Unknown Object (File)
May 12 2024, 8:47 PM
Unknown Object (File)
May 12 2024, 4:25 PM
Unknown Object (File)
May 12 2024, 1:12 PM
Unknown Object (File)
May 8 2024, 5:22 AM
Subscribers

Details

Reviewers
eadler
gnn
sbruno
hrs
cy
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rS336150: top(1): Fix the prompt bug and core dump problem in o / p mode that occurred by…
Summary

top(1): Fix the prompt bug and core dump problem in o / p mode that occurred by r336028

Test Plan

top (r336028):

  1. top -a
  2. type: o
  3. ISSUE1: Prompt is not displayed
  4. type: pid[return]
  5. Increase the width of your terminal
  6. ISSUE2: Core dumped

top (patched)

  1. top -a
  2. type: o
  3. FIXED1: You can see the prompt
  4. type: pid[return]
  5. Increase the width of your terminal
  6. FIXED2: Works

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cy requested changes to this revision.Jul 8 2018, 6:31 AM

Also, can you resubmit with diff -U99999? With svn: svn diff -x -U99999. With git: git diff -U99999. This will improve context.

usr.bin/top/display.c
963 ↗(On Diff #45006)

My original email was incorrect. This should be setup_buffer_bufsiz instead.

+ 5 should always be the same as second argument to setup_buffer(). It is now but it should be a macro to ensure they are the same, avoiding someone changing one and not the other.

This revision now requires changes to proceed.Jul 8 2018, 6:31 AM

Corresponded to Cy's advise. Thank you.

gnn requested changes to this revision.Jul 8 2018, 4:21 PM
gnn added inline comments.
usr.bin/top/display.c
1355 ↗(On Diff #45007)

Can the 2 here be # defined or added to one of the other sizes so that it's not a "magic number" ?

This revision now requires changes to proceed.Jul 8 2018, 4:21 PM
cy requested changes to this revision.Jul 9 2018, 6:36 AM
cy added inline comments.
usr.bin/top/display.c
1355 ↗(On Diff #45007)

Why +2? Why is it not a part of addlen?

Eliminated magic numbers according to George's advice.

Thanks for all your work daichi@.

This revision is now accepted and ready to land.Jul 9 2018, 7:16 PM
This revision was automatically updated to reflect the committed changes.
Owners added a reviewer: Restricted Owners Package.Jul 10 2018, 12:20 AM