Skip to content

Commit b0402f2

Browse files
committed
minor simplification
1 parent 4fb9c63 commit b0402f2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tv/tv.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,16 @@ static void showStats() {
110110

111111
static void emitCommandLine(ostream *out) {
112112
#ifdef __linux__
113-
ifstream cmd_args;
114-
cmd_args.open("/proc/self/cmdline");
113+
ifstream cmd_args("/proc/self/cmdline");
115114
if (!cmd_args.is_open()) {
116-
cerr << "Alive2: Couldn't open /proc/self/cmdline" << endl;
117-
exit(1);
115+
return;
118116
}
119-
*out << "Command line: ";
117+
*out << "Command line:";
120118
std::string arg;
121119
while (std::getline(cmd_args, arg, '\0'))
122-
*out << "'" << arg << "' ";
123-
#else
124-
*out << "Command line: not available on this platform";
125-
#endif
120+
*out << " '" << arg << "'";
126121
*out << "\n\n";
122+
#endif
127123
}
128124

129125
struct TVLegacyPass final : public llvm::ModulePass {

0 commit comments

Comments
 (0)