Browse Source

O_BINARY for cygwin, volatile for sig_atomic_t (merged [286], [287])

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@505 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 17 years ago
parent
commit
c25cf5a056
  1. 4
      src/base.h
  2. 6
      src/mod_compress.c
  3. 6
      src/server.c
  4. 2
      src/stream.c

4
src/base.h

@ -34,6 +34,10 @@
# include <fam.h>
#endif
#ifndef O_BINARY
# define O_BINARY 0
#endif
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif

6
src/mod_compress.c

@ -383,7 +383,7 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
buffer_append_string_buffer(p->ofn, sce->etag);
if (-1 == (ofd = open(p->ofn->ptr, O_WRONLY | O_CREAT | O_EXCL, 0600))) {
if (-1 == (ofd = open(p->ofn->ptr, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0600))) {
if (errno == EEXIST) {
/* cache-entry exists */
#if 0
@ -401,7 +401,7 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
#if 0
log_error_write(srv, __FILE__, __LINE__, "bs", p->ofn, "compress-cache miss");
#endif
if (-1 == (ifd = open(filename, O_RDONLY))) {
if (-1 == (ifd = open(filename, O_RDONLY | O_BINARY))) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "opening plain-file", fn, "failed", strerror(errno));
close(ofd);
@ -473,7 +473,7 @@ static int deflate_file_to_buffer(server *srv, connection *con, plugin_data *p,
if (sce->st.st_size > SIZE_MAX) return -1;
if (-1 == (ifd = open(fn->ptr, O_RDONLY))) {
if (-1 == (ifd = open(fn->ptr, O_RDONLY | O_BINARY))) {
log_error_write(srv, __FILE__, __LINE__, "sbss", "opening plain-file", fn, "failed", strerror(errno));
return -1;

6
src/server.c

@ -58,9 +58,9 @@ const char *patches[] = { "SERVERsocket", "HTTPurl", "HTTPhost", "HTTPreferer",
/* #define USE_ALARM */
#endif
static sig_atomic_t srv_shutdown = 0;
static sig_atomic_t handle_sig_alarm = 1;
static sig_atomic_t handle_sig_hup = 0;
static volatile sig_atomic_t srv_shutdown = 0;
static volatile sig_atomic_t handle_sig_alarm = 1;
static volatile sig_atomic_t handle_sig_hup = 0;
#if defined(HAVE_SIGACTION) && defined(SA_SIGINFO)
static void sigaction_handler(int sig, siginfo_t *si, void *context) {

2
src/stream.c

@ -27,7 +27,7 @@ int stream_open(stream *f, buffer *fn) {
f->size = st.st_size;
#ifdef HAVE_MMAP
if (-1 == (fd = open(fn->ptr, O_RDONLY))) {
if (-1 == (fd = open(fn->ptr, O_RDONLY | O_BINARY))) {
return -1;
}

Loading…
Cancel
Save