- 44DF7FD78D25997FD3E84E4DF43EA6511DE2AED69DCED33A64A14D9C918CA34EEA4D5FD1AFFF711B490991CE90F90CF67052433CDD5FCCDA08BB974E75F0929D+ A8B85AA6DBA112F0E314BD86F737D2FEF1206E4AD81B4C346C053D2BF3E4F36A1F5687DCD1321A0A7F3884DB1FB31FFCE69603AFB78F7C4E1B5CA638840A4404bitcoin/src/init.cpp(25 . 10)(25 . 6)
100
101 void ExitTimeout(void* parg)
102 {
103 #ifdef WIN32
104 Sleep(5000);
105 ExitProcess(0);
106 #endif
107 }
108
109 void Shutdown(void* parg)
(113 . 19)(109 . 8)
111
112 bool AppInit2(int argc, char* argv[])
113 {
114 #ifdef _MSC_VER
115 // Turn off microsoft heap dump noise
116 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
117 _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
118 #endif
119 #if _MSC_VER >= 1400
120 // Disable confusing "helpful" text message on abort, ctrl-c
121 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
122 #endif
123 #ifndef WIN32
124 umask(077);
125 #endif
126 #ifndef WIN32
127
128 // Clean shutdown on SIGTERM
129 struct sigaction sa;
130 sa.sa_handler = HandleSIGTERM;
(134 . 7)(119 . 6)
132 sigaction(SIGTERM, &sa, NULL);
133 sigaction(SIGINT, &sa, NULL);
134 sigaction(SIGHUP, &sa, NULL);
135 #endif
136
137 //
138 // Parameters
(189 . 16)(173 . 11)
140 " -maxreceivebuffer=<n>\t " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)\n") +
141 " -maxsendbuffer=<n>\t " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)\n") +
142 " -paytxfee=<amt> \t " + _("Fee per kB to add to transactions you send\n") +
143 #if !defined(WIN32)
144 " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
145 #endif
146 " -testnet \t\t " + _("Use the test network\n") +
147 " -debug \t\t " + _("Output extra debugging information\n") +
148 " -logtimestamps \t " + _("Prepend debug output with timestamp\n") +
149 " -printtoconsole \t " + _("Send trace/debug info to console instead of debug.log file\n") +
150 #ifdef WIN32
151 " -printtodebugger \t " + _("Send trace/debug info to debugger\n") +
152 #endif
153 " -rpcuser=<user> \t " + _("Username for JSON-RPC connections\n") +
154 " -rpcpassword=<pw>\t " + _("Password for JSON-RPC connections\n") +
155 " -rpcport=<port> \t\t " + _("Listen for JSON-RPC connections on <port> (default: 8332)\n") +
(218 . 12)(197 . 7)
157
158 fTestNet = GetBoolArg("-testnet");
159 fDebug = GetBoolArg("-debug");
160
161 #if !defined(WIN32)
162 fDaemon = GetBoolArg("-daemon");
163 #else
164 fDaemon = false;
165 #endif
166
167 if (fDaemon)
168 fServer = true;
(246 . 7)(220 . 6)
170 exit(ret);
171 }
172
173 #if !defined(WIN32)
174 if (fDaemon)
175 {
176 // Daemonize
(266 . 7)(239 . 6)
178 if (sid < 0)
179 fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno);
180 }
181 #endif
182
183 if (!fDebug && !pszSetDataDir[0])
184 ShrinkDebugFile();