fs9p.cc (12187:21448d4fdaae) fs9p.cc (12559:55550caed7f0)
1/*
2 * Copyright (c) 2014-2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 357 unchanged lines hidden (view full) ---

366 const std::string socket_path = simout.resolve(p->socketPath);
367 fatal_if(!OutputDirectory::isAbsolute(socket_path), "Please make the" \
368 " output directory an absolute path, else diod will fail!\n");
369
370 // Prevent overflow in strcpy
371 fatal_if(sizeof(socket_address.sun_path) <= socket_path.length(),
372 "Incorrect length of socket path");
373 strncpy(socket_address.sun_path, socket_path.c_str(),
1/*
2 * Copyright (c) 2014-2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 357 unchanged lines hidden (view full) ---

366 const std::string socket_path = simout.resolve(p->socketPath);
367 fatal_if(!OutputDirectory::isAbsolute(socket_path), "Please make the" \
368 " output directory an absolute path, else diod will fail!\n");
369
370 // Prevent overflow in strcpy
371 fatal_if(sizeof(socket_address.sun_path) <= socket_path.length(),
372 "Incorrect length of socket path");
373 strncpy(socket_address.sun_path, socket_path.c_str(),
374 sizeof(socket_address.sun_path));
374 sizeof(socket_address.sun_path) - 1);
375 if (bind(socket_id, (struct sockaddr*) &socket_address,
376 sizeof(struct sockaddr_un)) == -1){
377 perror("Socket binding");
378 panic("Socket binding to %i failed - most likely the output dir" \
379 " and hence unused socket already exists \n", socket_id);
380 }
381
382 diod_pid = fork();

--- 199 unchanged lines hidden ---
375 if (bind(socket_id, (struct sockaddr*) &socket_address,
376 sizeof(struct sockaddr_un)) == -1){
377 perror("Socket binding");
378 panic("Socket binding to %i failed - most likely the output dir" \
379 " and hence unused socket already exists \n", socket_id);
380 }
381
382 diod_pid = fork();

--- 199 unchanged lines hidden ---