if [ $MD5 != NO ]; then
echo "$MD5/libmd5.a:" >> $MAKEFILE
- echo " cd $MD5 && \$(MAKE) x86-elf" >> $MAKEFILE
+
+ case $PLATFORM in
+
+ SunOS:*)
+ echo " cd $MD5 && \$(MAKE) x86-solaris" >> $MAKEFILE
+ ;;
+
+ *)
+ echo " cd $MD5 && \$(MAKE) x86-elf" >> $MAKEFILE
+ ;;
+ esac
+
echo >> $MAKEFILE
fi
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $LINUX_DEPS"
-CORE_SRCS="$UNIX_SRCS $LINUX_SRCS $SELECT_SRCS $POLL_SRCS"
-EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE $POLL_MODULE"
+CORE_SRCS="$UNIX_SRCS $LINUX_SRCS"
+EVENT_MODULES="$EVENT_MODULES"
ZLIB_LIB="-lz"
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS"
-CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS $SELECT_SRCS $POLL_SRCS"
-EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE $POLL_MODULE"
+CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
+EVENT_MODULES="$EVENT_MODULES"
MD5_LIB="-lmd5"
ZLIB_LIB="-lz"
ngx_uint_t ngx_connection_counter;
ngx_int_t ngx_process;
+ngx_pid_t ngx_pid;
ngx_pid_t ngx_new_binary;
ngx_int_t ngx_inherited;
#endif
log = ngx_log_init_errlog();
+ ngx_pid = ngx_getpid();
/* init_cycle->log is required for signal handlers */
}
}
- if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "dup2(STDERR) failed");
- return 1;
- }
-
if (ccf->pid.len == 0) {
ccf->pid.len = sizeof(NGINX_PID) - 1;
ccf->pid.data = NGINX_PID;
#define _NGX_CONFIG_H_INCLUDED_
-#include <ngx_auto_config.h>
-
-
#if 1
/* STUB to allocate a big ngx_connections */
#undef FD_SETSIZE
#else /* posix */
+#include <ngx_auto_config.h>
+
#endif
}
}
+ /* TODO: Win32 DuplicateHandle ? */
+ if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
+ ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
+ "dup2(STDERR) failed");
+ failed = 1;
+ }
+
+
if (failed) {
/* rollback the new cycle configuration */
return NULL;
}
+
/* commit the new cycle configuration */
pool->log = cycle->log;
file[i].fd = fd;
}
+
+ /* TODO: Win32 DuplicateHandle ? */
+ if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
+ ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
+ "dup2(STDERR) failed");
+ }
}
/* pid#tid */
len += ngx_snprintf(errstr + len, max - len,
- PID_T_FMT "#%d: ", ngx_getpid(), /* STUB */ 0);
+ PID_T_FMT "#%d: ", ngx_pid, /* STUB */ 0);
if (log->data) {
len += ngx_snprintf(errstr + len, max - len,
#if (HAVE_DEVPOLL)
extern ngx_module_t ngx_devpoll_module;
+extern ngx_event_module_t ngx_devpoll_module_ctx;
#endif
#if (HAVE_AIO)
old_ecf = NULL;
}
+
for (m = 0; ngx_modules[m]; m++) {
if (ngx_modules[m]->type != NGX_EVENT_MODULE) {
continue;
ecf->use = ngx_modules[m]->ctx_index;
ecf->name = module->name->data;
- if (old_ecf && old_ecf->use != ecf->use) {
+ if (ngx_process == NGX_PROCESS_SINGLE
+ && old_ecf
+ && old_ecf->use != ecf->use)
+ {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "when the server runs without a master process "
"the \"%s\" event type must be the same as "
"in previous configuration - \"%s\" "
"and it can not be changed on the fly, "
"to change it you need to stop server "
"and start it again",
value[1].data, old_ecf->name);
+
return NGX_CONF_ERROR;
}
exit(0);
}
+ ngx_pid = ngx_getpid();
+
if (setsid() == -1) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "setsid() failed");
return NGX_ERROR;
#include <dirent.h>
#include <osreldate.h>
+#include <ngx_auto_config.h>
+
#ifndef HAVE_SELECT
#define HAVE_SELECT 1
#include <sys/sysctl.h>
#include <sys/wait.h>
#include <sys/socket.h>
-
-#if (HAVE_SENDFILE64)
-#include <sys/sendfile.h>
-#else
-extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
-#endif
-
#include <netinet/in.h>
#include <netinet/tcp.h> /* TCP_CORK */
#include <arpa/inet.h>
#include <netdb.h>
#include <dirent.h>
+#include <ngx_auto_config.h>
+
+#if (HAVE_SENDFILE64)
+#include <sys/sendfile.h>
+#else
+extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
+#endif
+
#ifndef HAVE_SELECT
return NGX_ERROR;
case 0:
+ ngx_pid = ngx_getpid();
proc(cycle, data);
break;
void ngx_respawn_processes(ngx_cycle_t *cycle);
void ngx_process_get_status(void);
+extern ngx_pid_t ngx_pid;
extern ngx_uint_t ngx_last_process;
extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES];
#include <netdb.h>
#include <dirent.h>
+#include <ngx_auto_config.h>
+
#ifndef HAVE_SELECT
#define HAVE_SELECT 1