extractor_ipc_gnu.c (libextractor-1.10) | : | extractor_ipc_gnu.c (libextractor-1.11) | ||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
along with libextractor; see the file COPYING. If not, write to the | along with libextractor; see the file COPYING. If not, write to the | |||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
Boston, MA 02110-1301, USA. | Boston, MA 02110-1301, USA. | |||
*/ | */ | |||
/** | /** | |||
* @file main/extractor_ipc_gnu.c | * @file main/extractor_ipc_gnu.c | |||
* @brief IPC with plugin for GNU/POSIX systems | * @brief IPC with plugin for GNU/POSIX systems | |||
* @author Christian Grothoff | * @author Christian Grothoff | |||
*/ | */ | |||
#include "platform.h" | #include "platform.h" | |||
#include "plibc.h" | ||||
#include "extractor.h" | #include "extractor.h" | |||
#include "extractor_datasource.h" | #include "extractor_datasource.h" | |||
#include "extractor_logging.h" | #include "extractor_logging.h" | |||
#include "extractor_plugin_main.h" | #include "extractor_plugin_main.h" | |||
#include "extractor_plugins.h" | #include "extractor_plugins.h" | |||
#include "extractor_ipc.h" | #include "extractor_ipc.h" | |||
#include <dirent.h> | #include <dirent.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/wait.h> | #include <sys/wait.h> | |||
#include <sys/shm.h> | #include <sys/shm.h> | |||
skipping to change at line 156 | skipping to change at line 155 | |||
if (NULL == tpath) | if (NULL == tpath) | |||
tpath = "/tmp/"; | tpath = "/tmp/"; | |||
#else | #else | |||
tpath = "/"; /* Linux */ | tpath = "/"; /* Linux */ | |||
#endif | #endif | |||
snprintf (shm->shm_name, | snprintf (shm->shm_name, | |||
MAX_SHM_NAME, | MAX_SHM_NAME, | |||
"%sLE-%u-%u", | "%sLE-%u-%u", | |||
tpath, | tpath, | |||
getpid (), | getpid (), | |||
(unsigned int) RANDOM ()); | (unsigned int) random ()); | |||
if (-1 == (shm->shm_id = shm_open (shm->shm_name, | if (-1 == (shm->shm_id = shm_open (shm->shm_name, | |||
O_RDWR | O_CREAT, | O_RDWR | O_CREAT, | |||
S_IRUSR | S_IWUSR))) | S_IRUSR | S_IWUSR))) | |||
{ | { | |||
LOG_STRERROR_FILE ("shm_open", | LOG_STRERROR_FILE ("shm_open", | |||
shm->shm_name); | shm->shm_name); | |||
free (shm); | free (shm); | |||
return NULL; | return NULL; | |||
} | } | |||
if ( (0 != ftruncate (shm->shm_id, size)) || | if ( (0 != ftruncate (shm->shm_id, size)) || | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added |