MCPcopy Create free account
hub / github.com/creatale/node-dv / CatchSignals

Method CatchSignals

deps/tesseract/api/baseapi.cpp:180–193  ·  view source on GitHub ↗

* Writes the thresholded image to stderr as a PBM file on receipt of a * SIGSEGV, SIGFPE, or SIGBUS signal. (Linux/Unix only). */

Source from the content-addressed store, hash-verified

178 * SIGSEGV, SIGFPE, or SIGBUS signal. (Linux/Unix only).
179 */
180void TessBaseAPI::CatchSignals() {
181#ifdef __linux__
182 struct sigaction action;
183 memset(&action, 0, sizeof(action));
184 action.sa_handler = &signal_exit;
185 action.sa_flags = SA_RESETHAND;
186 sigaction(SIGSEGV, &action, NULL);
187 sigaction(SIGFPE, &action, NULL);
188 sigaction(SIGBUS, &action, NULL);
189#else
190 // Warn API users that an implementation is needed.
191 tprintf("CatchSignals has no non-linux implementation!\n");
192#endif
193}
194
195/**
196 * Set the name of the input file. Needed only for training and

Callers

nothing calls this directly

Calls 1

sigactionClass · 0.85

Tested by

no test coverage detected