summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/src/tox-bootstrapd.c
diff options
context:
space:
mode:
Diffstat (limited to 'other/bootstrap_daemon/src/tox-bootstrapd.c')
-rw-r--r--other/bootstrap_daemon/src/tox-bootstrapd.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c
index e0472cba..bdf679c9 100644
--- a/other/bootstrap_daemon/src/tox-bootstrapd.c
+++ b/other/bootstrap_daemon/src/tox-bootstrapd.c
@@ -65,7 +65,7 @@ static int manage_keys(DHT *dht, char *keys_file_path)
65 // Check if file exits, proceed to open and load keys 65 // Check if file exits, proceed to open and load keys
66 keys_file = fopen(keys_file_path, "r"); 66 keys_file = fopen(keys_file_path, "r");
67 67
68 if (keys_file != NULL) { 68 if (keys_file != nullptr) {
69 const size_t read_size = fread(keys, sizeof(uint8_t), KEYS_SIZE, keys_file); 69 const size_t read_size = fread(keys, sizeof(uint8_t), KEYS_SIZE, keys_file);
70 70
71 if (read_size != KEYS_SIZE) { 71 if (read_size != KEYS_SIZE) {
@@ -131,7 +131,7 @@ static void daemonize(LOG_BACKEND log_backend, char *pid_file_path)
131 // Open the PID file for writing 131 // Open the PID file for writing
132 pid_file = fopen(pid_file_path, "a+"); 132 pid_file = fopen(pid_file_path, "a+");
133 133
134 if (pid_file == NULL) { 134 if (pid_file == nullptr) {
135 log_write(LOG_LEVEL_ERROR, "Couldn't open the PID file for writing: %s. Exiting.\n", pid_file_path); 135 log_write(LOG_LEVEL_ERROR, "Couldn't open the PID file for writing: %s. Exiting.\n", pid_file_path);
136 exit(1); 136 exit(1);
137 } 137 }
@@ -226,16 +226,16 @@ int main(int argc, char *argv[])
226 IP ip; 226 IP ip;
227 ip_init(&ip, enable_ipv6); 227 ip_init(&ip, enable_ipv6);
228 228
229 Networking_Core *net = new_networking(NULL, ip, port); 229 Networking_Core *net = new_networking(nullptr, ip, port);
230 230
231 if (net == NULL) { 231 if (net == nullptr) {
232 if (enable_ipv6 && enable_ipv4_fallback) { 232 if (enable_ipv6 && enable_ipv4_fallback) {
233 log_write(LOG_LEVEL_WARNING, "Couldn't initialize IPv6 networking. Falling back to using IPv4.\n"); 233 log_write(LOG_LEVEL_WARNING, "Couldn't initialize IPv6 networking. Falling back to using IPv4.\n");
234 enable_ipv6 = 0; 234 enable_ipv6 = 0;
235 ip_init(&ip, enable_ipv6); 235 ip_init(&ip, enable_ipv6);
236 net = new_networking(NULL, ip, port); 236 net = new_networking(nullptr, ip, port);
237 237
238 if (net == NULL) { 238 if (net == nullptr) {
239 log_write(LOG_LEVEL_ERROR, "Couldn't fallback to IPv4. Exiting.\n"); 239 log_write(LOG_LEVEL_ERROR, "Couldn't fallback to IPv4. Exiting.\n");
240 return 1; 240 return 1;
241 } 241 }
@@ -245,9 +245,9 @@ int main(int argc, char *argv[])
245 } 245 }
246 } 246 }
247 247
248 DHT *dht = new_DHT(NULL, net, true); 248 DHT *dht = new_DHT(nullptr, net, true);
249 249
250 if (dht == NULL) { 250 if (dht == nullptr) {
251 log_write(LOG_LEVEL_ERROR, "Couldn't initialize Tox DHT instance. Exiting.\n"); 251 log_write(LOG_LEVEL_ERROR, "Couldn't initialize Tox DHT instance. Exiting.\n");
252 return 1; 252 return 1;
253 } 253 }
@@ -280,7 +280,7 @@ int main(int argc, char *argv[])
280 280
281 free(keys_file_path); 281 free(keys_file_path);
282 282
283 TCP_Server *tcp_server = NULL; 283 TCP_Server *tcp_server = nullptr;
284 284
285 if (enable_tcp_relay) { 285 if (enable_tcp_relay) {
286 if (tcp_relay_port_count == 0) { 286 if (tcp_relay_port_count == 0) {
@@ -293,7 +293,7 @@ int main(int argc, char *argv[])
293 // tcp_relay_port_count != 0 at this point 293 // tcp_relay_port_count != 0 at this point
294 free(tcp_relay_ports); 294 free(tcp_relay_ports);
295 295
296 if (tcp_server != NULL) { 296 if (tcp_server != nullptr) {
297 log_write(LOG_LEVEL_INFO, "Initialized Tox TCP server successfully.\n"); 297 log_write(LOG_LEVEL_INFO, "Initialized Tox TCP server successfully.\n");
298 } else { 298 } else {
299 log_write(LOG_LEVEL_ERROR, "Couldn't initialize Tox TCP server. Exiting.\n"); 299 log_write(LOG_LEVEL_ERROR, "Couldn't initialize Tox TCP server. Exiting.\n");
@@ -332,7 +332,7 @@ int main(int argc, char *argv[])
332 do_TCP_server(tcp_server); 332 do_TCP_server(tcp_server);
333 } 333 }
334 334
335 networking_poll(dht_get_net(dht), NULL); 335 networking_poll(dht_get_net(dht), nullptr);
336 336
337 if (waiting_for_dht_connection && DHT_isconnected(dht)) { 337 if (waiting_for_dht_connection && DHT_isconnected(dht)) {
338 log_write(LOG_LEVEL_INFO, "Connected to another bootstrap node successfully.\n"); 338 log_write(LOG_LEVEL_INFO, "Connected to another bootstrap node successfully.\n");