diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-02-03 05:51:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-02-03 05:51:14 +0000 |
commit | f4664618a7f42225b3342006f91a7d39e7719e07 (patch) | |
tree | b3cc18ea1388540edcadeb08e224071b6d410d5e | |
parent | d23b9ca732986978d74bbf689c75d5a51f104ea7 (diff) | |
download | libmicrohttpd-f4664618a7f42225b3342006f91a7d39e7719e07.tar.gz libmicrohttpd-f4664618a7f42225b3342006f91a7d39e7719e07.zip |
w32
-rw-r--r-- | src/daemon/daemon.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 8bfce082..b824e9ea 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -1127,18 +1127,23 @@ static void | |||
1127 | sigalrmHandler (int sig) | 1127 | sigalrmHandler (int sig) |
1128 | { | 1128 | { |
1129 | } | 1129 | } |
1130 | #endif | ||
1130 | 1131 | ||
1131 | /** | 1132 | /** |
1132 | * Initialize the signal handler for SIGALRM. | 1133 | * Initialize the signal handler for SIGALRM. |
1133 | */ | 1134 | */ |
1134 | void __attribute__ ((constructor)) MHD_pthread_handlers_ltdl_init () | 1135 | void __attribute__ ((constructor)) MHD_pthread_handlers_ltdl_init () |
1135 | { | 1136 | { |
1137 | #ifndef WINDOWS | ||
1136 | /* make sure SIGALRM does not kill us */ | 1138 | /* make sure SIGALRM does not kill us */ |
1137 | memset (&sig, 0, sizeof (struct sigaction)); | 1139 | memset (&sig, 0, sizeof (struct sigaction)); |
1138 | memset (&old, 0, sizeof (struct sigaction)); | 1140 | memset (&old, 0, sizeof (struct sigaction)); |
1139 | sig.sa_flags = SA_NODEFER; | 1141 | sig.sa_flags = SA_NODEFER; |
1140 | sig.sa_handler = &sigalrmHandler; | 1142 | sig.sa_handler = &sigalrmHandler; |
1141 | sigaction (SIGALRM, &sig, &old); | 1143 | sigaction (SIGALRM, &sig, &old); |
1144 | #else | ||
1145 | plibc_init ("CRISP", "libmicrohttpd"); | ||
1146 | #endif | ||
1142 | #if HTTPS_SUPPORT | 1147 | #if HTTPS_SUPPORT |
1143 | if (0 != pthread_mutex_init(&MHD_gnutls_init_mutex, NULL)) | 1148 | if (0 != pthread_mutex_init(&MHD_gnutls_init_mutex, NULL)) |
1144 | abort(); | 1149 | abort(); |
@@ -1151,19 +1156,11 @@ void __attribute__ ((destructor)) MHD_pthread_handlers_ltdl_fini () | |||
1151 | if (0 != pthread_mutex_destroy(&MHD_gnutls_init_mutex)) | 1156 | if (0 != pthread_mutex_destroy(&MHD_gnutls_init_mutex)) |
1152 | abort (); | 1157 | abort (); |
1153 | #endif | 1158 | #endif |
1159 | #ifndef WINDOWS | ||
1154 | sigaction (SIGALRM, &old, &sig); | 1160 | sigaction (SIGALRM, &old, &sig); |
1155 | } | ||
1156 | |||
1157 | #else | 1161 | #else |
1158 | void __attribute__ ((constructor)) MHD_win_ltdl_init () | ||
1159 | { | ||
1160 | plibc_init ("CRISP", "libmicrohttpd"); | ||
1161 | } | ||
1162 | |||
1163 | void __attribute__ ((destructor)) MHD_win_ltdl_fini () | ||
1164 | { | ||
1165 | plibc_shutdown (); | 1162 | plibc_shutdown (); |
1166 | } | ||
1167 | #endif | 1163 | #endif |
1164 | } | ||
1168 | 1165 | ||
1169 | /* end of daemon.c */ | 1166 | /* end of daemon.c */ |