Skip to content

Commit

Permalink
build: Include <unistd.h> for isatty()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ppisar committed Jan 31, 2024
1 parent 2427a33 commit 3f4b61f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libdnf5-cli/output/advisorylist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "utils/string.hpp"

#include <libsmartcols/libsmartcols.h>
#include <unistd.h>

namespace libdnf5::cli::output {

Expand Down

0 comments on commit 3f4b61f

Please sign in to comment.