MCPcopy Create free account
hub / github.com/apache/impala / HasProgram

Method HasProgram

be/src/kudu/util/pstack_watcher.cc:96–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96Status PstackWatcher::HasProgram(const char* progname) {
97 Subprocess proc({ "which", progname } );
98 proc.DisableStderr();
99 proc.DisableStdout();
100 RETURN_NOT_OK_PREPEND(proc.Start(),
101 Substitute("HasProgram($0): error running 'which'", progname));
102 RETURN_NOT_OK(proc.Wait());
103 int exit_status;
104 string exit_info;
105 RETURN_NOT_OK(proc.GetExitStatus(&exit_status, &exit_info));
106 if (exit_status == 0) {
107 return Status::OK();
108 }
109 return Status::NotFound(Substitute("can't find $0: $1", progname, exit_info));
110}
111
112Status PstackWatcher::HasGoodGdb() {
113 // Check for the existence of gdb.

Callers

nothing calls this directly

Calls 8

SubstituteFunction · 0.85
OKFunction · 0.85
NotFoundFunction · 0.85
DisableStderrMethod · 0.80
DisableStdoutMethod · 0.80
GetExitStatusMethod · 0.80
StartMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected