uavcan_dynamic_node_id_server will not run if stdout is not a tty

This commit is contained in:
Pavel Kirienko
2015-05-24 16:53:58 +03:00
parent e5f3a96476
commit 1234494e77
@@ -618,6 +618,12 @@ int main(int argc, const char** argv)
{
try
{
if (isatty(STDOUT_FILENO) != 1)
{
std::cerr << "This application cannot run if stdout is not associated with a terminal" << std::endl;
std::exit(1);
}
auto options = parseOptions(argc, argv);
std::cout << "Self node ID: " << int(options.node_id.get()) << "\n"