mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Ignore SIGPIPE
It's possible to receive SIGPIPE sometimes which by default causes application to terminate. This makes the downloader ignore SIGPIPE.
This commit is contained in:
parent
70d2fdbefc
commit
521eea8522
8
main.cpp
8
main.cpp
@ -15,6 +15,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
namespace bpo = boost::program_options;
|
namespace bpo = boost::program_options;
|
||||||
Config Globals::globalConfig;
|
Config Globals::globalConfig;
|
||||||
@ -26,6 +27,13 @@ template<typename T> void set_vm_value(std::map<std::string, bpo::variable_value
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
struct sigaction act;
|
||||||
|
act.sa_handler = SIG_IGN;
|
||||||
|
act.sa_flags = SA_RESTART;
|
||||||
|
sigemptyset(&act.sa_mask);
|
||||||
|
if (sigaction(SIGPIPE, &act, NULL) < 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
rhash_library_init();
|
rhash_library_init();
|
||||||
|
|
||||||
// Constants for option selection with include/exclude
|
// Constants for option selection with include/exclude
|
||||||
|
Loading…
x
Reference in New Issue
Block a user