forked from Mirrors/privacore-open-source-search-engine
Fix cppcheck warning -> The function 'gbpopen' is never used.
This commit is contained in:
30
Loop.cpp
30
Loop.cpp
@ -1065,33 +1065,3 @@ int gbsystem(const char *cmd ) {
|
||||
g_loop.enableQuickpollTimer();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
FILE* gbpopen(char* cmd) {
|
||||
// Block everything from interrupting this system call because
|
||||
// if there is an alarm or a child thread crashes (pdftohtml)
|
||||
// then this will hang forever.
|
||||
// We should actually write our own popen so that we do
|
||||
// fork, close all fds in the child, then exec.
|
||||
// These child processes can hold open the http server and
|
||||
// prevent a new gb from running even after it has died.
|
||||
g_loop.disableQuickpollTimer();
|
||||
|
||||
sigset_t oldSigs;
|
||||
sigset_t sigs;
|
||||
sigfillset ( &sigs );
|
||||
|
||||
if ( sigprocmask ( SIG_BLOCK , &sigs, &oldSigs ) < 0 ) {
|
||||
log("build: had error blocking signals for popen");
|
||||
}
|
||||
FILE* fh = popen(cmd, "r");
|
||||
|
||||
if ( sigprocmask ( SIG_SETMASK , &oldSigs, NULL ) < 0 ) {
|
||||
log("build: had error unblocking signals for popen");
|
||||
}
|
||||
|
||||
g_loop.enableQuickpollTimer();
|
||||
return fh;
|
||||
}
|
||||
|
||||
|
||||
|
1
Loop.h
1
Loop.h
@ -20,7 +20,6 @@
|
||||
#define QUICKPOLL_INTERVAL 10
|
||||
|
||||
int gbsystem(const char *cmd);
|
||||
FILE* gbpopen(char* cmd);
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user