Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using cleanstop() causes non-zero exit, but does not show an error message (because it clears the screen) #67

Closed
sourcejedi opened this issue Jun 20, 2019 · 2 comments

Comments

@sourcejedi
Copy link

$ rpm -q atop
atop-2.3.0-10.fc28.x86_64

When atop hits a fatal error, it does not show an error message.

I happened to run atop after I had changed directory (cd) into a mounted USB stick. The "error" was that the USB connection was lost. Then atop died without printing any error (and returned exit status 53).

$ atop
$ echo $?
53

src/atop$ grep -r 'exit[ ]*[(]' .
...
various.c
577:		exit(13);
590:	exit(exitcode);
...
src/atop$ grep -r '53' .
...
photosyst.c
101:** Revision 1.16  2004/05/06 09:53:31  gerlof
107:** Revision 1.14  2003/07/08 13:53:21  gerlof
305:		cleanstop(53);
...

In the function photosyst():

	if ( getcwd(origdir, sizeof origdir) == NULL)
	{
		perror("save current dir");
		cleanstop(53);
	}

I see atop tries to print an error message. But then I expect cleanstop() restores the original screen. So it wipes out the error message :-).

Atoptool added a commit that referenced this issue Aug 3, 2019
By introducing function mcleanstop, error messages are
shown after ncurses has closed the window (solves issue #67).
@Atoptool
Copy link
Owner

Atoptool commented Aug 3, 2019

New function mcleanstop (write error message after ncurses closed the window) solves this issue.

@Atoptool Atoptool closed this as completed Aug 3, 2019
@sourcejedi
Copy link
Author

Great! Thanks for the amazing program :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants