Silence some Solaris warnings reported by Paul Hargrove
cmr=v1.7.4:reviewer=jsquyres:subject=Silence some Solaris warnings This commit was SVN r30542.
Этот коммит содержится в:
родитель
fa02bba7c5
Коммит
fab35dbffa
@ -43,6 +43,13 @@ AC_DEFUN([OPAL_CHECK_OS_FLAVORS],
|
||||
OPAL_CHECK_OS_FLAVOR_SPECIFIC([__linux__], [linux])
|
||||
OPAL_CHECK_OS_FLAVOR_SPECIFIC([__sun__], [sun])
|
||||
|
||||
AS_IF([test "$opal_found_sun" = "yes"],
|
||||
[opal_have_solaris=1],
|
||||
[opal_have_solaris=0])
|
||||
AC_DEFINE_UNQUOTED([OPAL_HAVE_SOLARIS],
|
||||
[$opal_have_solaris],
|
||||
[Whether or not we have solaris])
|
||||
|
||||
# check for sockaddr_in (a good sign we have TCP)
|
||||
AC_CHECK_TYPES([struct sockaddr_in],
|
||||
[opal_found_sockaddr=yes],
|
||||
|
@ -14,6 +14,7 @@
|
||||
* Copyright (c) 2010-2011 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -31,9 +32,15 @@
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
#if OPAL_HAVE_SOLARIS && !defined(_POSIX_C_SOURCE)
|
||||
#define _POSIX_C_SOURCE 200112L /* Required for shm_{open,unlink} decls */
|
||||
#include <sys/mman.h>
|
||||
#undef _POSIX_C_SOURCE
|
||||
#else
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif /* HAVE_SYS_MMAN_H */
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
@ -13,7 +13,7 @@
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -27,9 +27,15 @@
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#if OPAL_HAVE_SOLARIS && !defined(_POSIX_C_SOURCE)
|
||||
#define _POSIX_C_SOURCE 200112L /* Required for shm_{open,unlink} decls */
|
||||
#include <sys/mman.h>
|
||||
#undef _POSIX_C_SOURCE
|
||||
#else
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif /* HAVE_SYS_MMAN_H */
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
@ -208,9 +214,9 @@ segment_create(opal_shmem_ds_t *ds_buf,
|
||||
rc = OPAL_ERROR;
|
||||
goto out;
|
||||
}
|
||||
else if (MAP_FAILED == (seg_hdrp = mmap(NULL, real_size,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
ds_buf->seg_id, 0))) {
|
||||
else if (MAP_FAILED == (seg_hdrp = (opal_shmem_seg_hdr_t*)mmap(NULL, real_size,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
ds_buf->seg_id, 0))) {
|
||||
int err = errno;
|
||||
char hn[MAXHOSTNAMELEN];
|
||||
gethostname(hn, MAXHOSTNAMELEN - 1);
|
||||
@ -284,7 +290,7 @@ out:
|
||||
shm_unlink(ds_buf->seg_name);
|
||||
}
|
||||
if (MAP_FAILED != seg_hdrp) {
|
||||
munmap(seg_hdrp, real_size);
|
||||
munmap((void*)seg_hdrp, real_size);
|
||||
}
|
||||
/* always invalidate in this error path */
|
||||
shmem_ds_reset(ds_buf);
|
||||
@ -312,9 +318,9 @@ segment_attach(opal_shmem_ds_t *ds_buf)
|
||||
return NULL;
|
||||
}
|
||||
else if (MAP_FAILED == (ds_buf->seg_base_addr =
|
||||
mmap(NULL, ds_buf->seg_size,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
ds_buf->seg_id, 0))) {
|
||||
(unsigned char*)mmap(NULL, ds_buf->seg_size,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
ds_buf->seg_id, 0))) {
|
||||
int err = errno;
|
||||
char hn[MAXHOSTNAMELEN];
|
||||
gethostname(hn, MAXHOSTNAMELEN - 1);
|
||||
@ -374,7 +380,7 @@ segment_detach(opal_shmem_ds_t *ds_buf)
|
||||
ds_buf->seg_id, (unsigned long)ds_buf->seg_size, ds_buf->seg_name)
|
||||
);
|
||||
|
||||
if (0 != munmap(ds_buf->seg_base_addr, ds_buf->seg_size)) {
|
||||
if (0 != munmap((void*)ds_buf->seg_base_addr, ds_buf->seg_size)) {
|
||||
int err = errno;
|
||||
char hn[MAXHOSTNAMELEN];
|
||||
gethostname(hn, MAXHOSTNAMELEN - 1);
|
||||
|
@ -274,7 +274,7 @@ out:
|
||||
if (OPAL_SUCCESS != rc) {
|
||||
/* best effort to delete the segment. */
|
||||
if ((void *)-1 != seg_hdrp) {
|
||||
shmdt(seg_hdrp);
|
||||
shmdt((char*)seg_hdrp);
|
||||
}
|
||||
shmctl(ds_buf->seg_id, IPC_RMID, NULL);
|
||||
|
||||
@ -338,7 +338,7 @@ segment_detach(opal_shmem_ds_t *ds_buf)
|
||||
ds_buf->seg_id, (unsigned long)ds_buf->seg_size, ds_buf->seg_name)
|
||||
);
|
||||
|
||||
if (0 != shmdt(ds_buf->seg_base_addr)) {
|
||||
if (0 != shmdt((char*)ds_buf->seg_base_addr)) {
|
||||
int err = errno;
|
||||
char hn[MAXHOSTNAMELEN];
|
||||
gethostname(hn, MAXHOSTNAMELEN - 1);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user