Subject: pkg/36877: net/nload builds, but doesn't work on solaris 10 (workaround)
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <serenity@exscape.org>
List: pkgsrc-bugs
Date: 09/01/2007 10:35:00
>Number:         36877
>Category:       pkg
>Synopsis:       net/nload builds, but doesn't work on solaris 10 (workaround)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 01 10:35:00 +0000 2007
>Originator:     Thomas Backman
>Release:        None, Solaris 10, pkgsrc-current
>Organization:
>Environment:
SunOS *.org 5.10 Generic_118855-33 i86pc i386 i86pc
>Description:
The package builds just fine, but doesn't work. When it's started, you get a blank screen and nothing happens until you press Ctrl+C and return to a garbled terminal.
>How-To-Repeat:
Install net/nload on Solaris (10 in my case), run "nload".
>Fix:
Edit src/main.cpp, and replace
while( ( key = getch() ) != ERR )
with
while( ( key = getch() ) != -1 )
Should be at line 314.

Then compile, and it runs.
The problem seems to be that both ncurses and Solaris(? or something else) defines ERR, to different values. nload expects it to be -1, though, and the loop freezes while waiting for getch() to return ERR.

The same problem exists in net/rtorrent, with the very same fix. I have no idea why, though. Also, this is my very first PR ever, so be gentle. :-)