libcryfs/test/cpp-utils/process/exit_status.cpp
Sebastian Messmer efac089c76 - Add Clang 8 and GCC 9 to CI
- Switch clang-tidy to Clang 9
- Fix compiler and clang-tidy warnings produced by the previous points
2019-06-08 13:06:17 -07:00

17 lines
405 B
C++

// This is a small executable that prints its first argument and exits with the exit status in its second argument
#include <iostream>
#include <cstdlib>
int main(int argc, char* argv[]) {
if (argc != 3) {
std::cerr << "Wrong number of arguments" << std::endl;
std::abort();
}
std::cout << argv[1];
int exit_status = static_cast<int>(std::strtol(argv[2], nullptr, 10));
return exit_status;
}