Commit 746cbc63 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Handle execvp() failures.

When running `Display' in TAF-Kit's editor would enter a warp zone
if dotty is not in PATH: because of the missing exit() after
execvp(), two forks of TAF-Kit's editor would compete for the
terminal.

* include/vaucanson/tools/out_display.hxx (out_display): Exit
if execvp returns an error, and report the failure.
parent 375a1ce4
2011-09-25 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Handle execvp() failures.
When running `Display' in TAF-Kit's editor would enter a warp zone
if dotty is not in PATH: because of the missing exit() after
execvp(), two forks of TAF-Kit's editor would compete for the
terminal.
* include/vaucanson/tools/out_display.hxx (out_display): Exit
if execvp returns an error, and report the failure.
2011-09-25 Alexandre Duret-Lutz <adl@lrde.epita.fr>
 
Use AC_LANG_SOURCE.
......
......@@ -2,7 +2,7 @@
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2005, 2006, 2007 The Vaucanson Group.
// Copyright (C) 2005, 2006, 2007, 2011 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
......@@ -92,7 +92,8 @@ namespace vcsn {
// explanation of why it is only declared as "char* const*".
// http://www.opengroup.org/onlinepubs/000095399/functions/exec.html
execvp(argv[0], const_cast<char *const *>(argv));
return false;
std::cerr << "Failed to execute `" << argv[0] << "'." << std::endl;
exit(1);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment