1
1

Patch for Cygwin support: Use S_IRWXU for shmget() and include

<sys/stat.h>.  Thanks to Marco Atzeri for reporting the issue and
providing an initial patch.

This commit was SVN r28060.
Этот коммит содержится в:
Jeff Squyres 2013-02-15 14:31:58 +00:00
родитель fde6207fe1
Коммит acefc1588e
2 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2011 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
@ -44,6 +44,9 @@
#if HAVE_SYS_SHM_H
#include <sys/shm.h>
#endif /* HAVE_SYS_SHM_H */
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
#include "opal/constants.h"
#include "opal/util/show_help.h"
@ -170,7 +173,7 @@ sysv_runtime_query(mca_base_module_t **module, int *priority, const char *hint)
);
if (-1 == (shmid = shmget(IPC_PRIVATE, (size_t)(getpagesize()),
IPC_CREAT | IPC_EXCL | SHM_R | SHM_W))) {
IPC_CREAT | IPC_EXCL | S_IRWXU ))) {
goto out;
}
else if ((void *)-1 == (addr = shmat(shmid, NULL, 0))) {

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
* All rights reserved.
@ -42,6 +42,9 @@
#if HAVE_SYS_SHM_H
#include <sys/shm.h>
#endif /* HAVE_SYS_SHM_H */
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
#ifdef HAVE_STRING_H
#include <string.h>
#endif /* HAVE_STRING_H */
@ -194,7 +197,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
* real_size here
*/
if (-1 == (ds_buf->seg_id = shmget(IPC_PRIVATE, real_size,
IPC_CREAT | IPC_EXCL | SHM_R | SHM_W))) {
IPC_CREAT | IPC_EXCL | S_IRWXU))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);