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

build: Include <unistd.h> for isatty() #1219

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Jan 31, 2024

A compilation fails on some systems with:

/home/rpm/rpmbuild/BUILD/libdnf5-cli/output/advisorylist.cpp: In function 'libscols_table* libdnf5::cli::output::create_advisorylist_table(std::string)':
/home/rpm/rpmbuild/BUILD/libdnf5-cli/output/advisorylist.cpp:33:9: error: 'isatty' was not declared in this scope
   33 |     if (isatty(1)) {
  |         ^~~~~~

The cause is a missing "#include <unistd.h>" in the compilation unit.

This bug was introduced in commit
d8d9c63 (Add output formatting for advisory list and info into libdnf-cli).

Fixes: #1168

A compilation fails on some systems with:

    /home/rpm/rpmbuild/BUILD/libdnf5-cli/output/advisorylist.cpp: In function 'libscols_table* libdnf5::cli::output::create_advisorylist_table(std::string)':
    /home/rpm/rpmbuild/BUILD/libdnf5-cli/output/advisorylist.cpp:33:9: error: 'isatty' was not declared in this scope
       33 |     if (isatty(1)) {
	  |         ^~~~~~

The cause is a missing "#include <unistd.h>" in the compilation unit.

This bug was introduced in commit
d8d9c63 (Add output formatting for
advisory list and info into libdnf-cli).

Fixes: rpm-software-management#1168
@j-mracek j-mracek self-assigned this Jan 31, 2024
@j-mracek
Copy link
Member

LGTM

@j-mracek j-mracek added this pull request to the merge queue Jan 31, 2024
Merged via the queue into rpm-software-management:main with commit 18e4faf Jan 31, 2024
5 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

FTBFS with gcc 10.x: 'isatty' was not declared in this scope
2 participants