Permalink
Browse files

We are not longer using shm_open(). Removes the last few references to

POSIX shared memory.

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6875 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent d12e63b commit 030c2680bcc2df73b9e3ca356570bde3898aeaa7 @alobbs alobbs committed Oct 1, 2011
Showing with 15 additions and 47 deletions.
  1. +3 −9 cherokee/Makefile.am
  2. +6 −4 cherokee/main.c
  3. +0 −4 cherokee/source_interpreter.c
  4. +6 −7 cherokee/spawner.c
  5. +0 −23 configure.in
View
@@ -1335,12 +1335,6 @@ win32_cservice.h \
win32_cservice.c
endif
-if USE_POSIX_SHM
-shm_src = \
-shm.h \
-shm.c
-endif
-
libcherokee_base_la_SOURCES = \
$(zlib_src) \
@@ -1353,7 +1347,6 @@ $(poll_port_src) \
$(poll_select_src) \
$(poll_win32_src) \
$(win32_src) \
-$(shm_src) \
cherokee.h \
init.h \
init.c \
@@ -1447,7 +1440,9 @@ logger.c \
logger_writer.h \
logger_writer.c \
xrealip.h \
-xrealip.c
+xrealip.c \
+shm.h \
+shm.c
libcherokee_client_la_SOURCES = \
@@ -1827,7 +1822,6 @@ errors.py \
error_list.py \
errors.h \
errors_defs.h \
-$(shm_src) \
$(pcre_src) \
$(win32_src) \
$(getopt_src) \
View
@@ -405,7 +405,7 @@ pid_file_clean (const char *pid_file)
free (pid_file_worker);
}
-#ifdef HAVE_POSIX_SHM
+#ifdef HAVE_SYSV_SEMAPHORES
static void
do_sem_op (int sem_num, int sem_op)
@@ -834,12 +834,14 @@ spawn_clean (void)
semctl (spawn_shared_sems, 0, IPC_RMID, dummy);
}
}
-#endif /* HAVE_POSIX_SHM */
+
+#endif /* HAVE_SYSV_SEMAPHORES */
+
static void
clean_up (void)
{
-#ifdef HAVE_POSIX_SHM
+#ifdef HAVE_SYSV_SEMAPHORES
spawn_clean();
#endif
pid_file_clean (pid_file_path);
@@ -1109,7 +1111,7 @@ main (int argc, char *argv[])
/* Launch the spawning thread
*/
-#ifdef HAVE_POSIX_SHM
+#ifdef HAVE_SYSV_SEMAPHORES
if (! single_time) {
ret = spawn_init();
if (ret != ret_ok) {
@@ -484,7 +484,6 @@ cherokee_source_interpreter_configure (cherokee_source_interpreter_t *src,
}
-#ifdef HAVE_POSIX_SHM
static ret_t
_spawn_shm (cherokee_source_interpreter_t *src,
cherokee_logger_writer_t *error_writer)
@@ -530,7 +529,6 @@ _spawn_shm (cherokee_source_interpreter_t *src,
return ret_ok;
}
-#endif
static ret_t
@@ -653,7 +651,6 @@ cherokee_source_interpreter_spawn (cherokee_source_interpreter_t *src,
/* Try with SHM first
*/
-#ifdef HAVE_POSIX_SHM
if ((src->spawn_type == spawn_shm) ||
(src->spawn_type == spawn_unknown))
{
@@ -672,7 +669,6 @@ cherokee_source_interpreter_spawn (cherokee_source_interpreter_t *src,
return ret_error;
}
}
-#endif
/* No luck, go 'local' then..
*/
View
@@ -52,7 +52,7 @@ cherokee_spawner_set_active (cherokee_boolean_t active)
ret_t
cherokee_spawner_init (void)
{
-#ifdef HAVE_POSIX_SHM
+#ifdef HAVE_SYSV_SEMAPHORES
ret_t ret;
cherokee_buffer_t name = CHEROKEE_BUF_INIT;
@@ -102,13 +102,11 @@ cherokee_spawner_free (void)
{
CHEROKEE_MUTEX_DESTROY (&spawning_mutex);
-#ifdef HAVE_POSIX_SHM
cherokee_shm_mrproper (&cherokee_spawn_shared);
-#endif
return ret_ok;
}
-#ifdef HAVE_POSIX_SHM
+
static ret_t
write_logger (cherokee_buffer_t *buf,
cherokee_logger_writer_t *error_writer)
@@ -146,7 +144,7 @@ write_logger (cherokee_buffer_t *buf,
cherokee_buffer_add (buf, (char *)&val, sizeof(int));
return ret_ok;
}
-#endif
+
static ret_t
do_sem_op (int sem_ref, int sem_num, int sem_op)
@@ -194,7 +192,7 @@ cherokee_spawner_spawn (cherokee_buffer_t *binary,
cherokee_logger_writer_t *error_writer,
pid_t *pid_ret)
{
-#ifdef HAVE_POSIX_SHM
+#ifdef HAVE_SYSV_SEMAPHORES
char **n;
int *pid_shm;
int pid_prev;
@@ -322,6 +320,7 @@ cherokee_spawner_spawn (cherokee_buffer_t *binary,
return ret_error;
#else
return ret_not_found;
-#endif
+
+#endif /* HAVE_SYSV_SEMAPHORES */
}
View
@@ -779,29 +779,6 @@ if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
fi
-dnl
-dnl Shared Memory
-dnl
-AC_CHECK_FUNC(shm_open, have_shm_open=yes)
-
-RT_LIBS=
-if test "$have_shm_open" != "yes"; then
- AC_CHECK_LIB(rt, shm_open, [
- RT_LIBS="-lrt"
- have_shm_open=yes])
-fi
-if test "$have_shm_open" != "yes"; then
- AC_CHECK_LIB(rt, shm_open, [
- RT_LIBS="-lposix4"
- have_shm_open=yes])
-fi
-AC_SUBST(RT_LIBS)
-
-if test "$have_shm_open" = "yes"; then
- AC_DEFINE(HAVE_POSIX_SHM, 1, [Define to 1 to use POSIX shared memory])
-fi
-AM_CONDITIONAL(USE_POSIX_SHM, test "$have_shm_open" = "yes")
-
dnl
dnl SYSV Semaphores

0 comments on commit 030c268

Please sign in to comment.