Fix cppcheck warning -> The function 'gbpopen' is never used.

This commit is contained in:
Ai Lin Chia
2016-08-08 15:49:06 +02:00
parent 89f55da1b2
commit fd63b08b6e
2 changed files with 0 additions and 31 deletions

@ -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

@ -20,7 +20,6 @@
#define QUICKPOLL_INTERVAL 10
int gbsystem(const char *cmd);
FILE* gbpopen(char* cmd);
/**