sigint_init(void)
{
SHOW("entering sigint_init()");
- install_handler(SIGINT, sigint_handler);
+ install_handler(SIGINT, sigint_handler, 1);
SHOW("leaving sigint_init()");
}
\f
It is mostly in the public domain; some portions are provided under\n\
BSD-style licenses. See the CREDITS and COPYING files in the\n\
distribution for more information.\n\
-", SBCL_VERSION_STRING);
+"
+#ifdef LISP_FEATURE_WIN32
+"\n\
+WARNING: the Windows port is fragile, particularly for multithreaded\n\
+code. Unfortunately, the development team currently lacks the time\n\
+and resources this platform demands.\n\
+"
+#endif
+, SBCL_VERSION_STRING);
}
/* Look for a core file to load, first in the directory named by the
return search;
}
}
+ /* The above for-loop fails to process the last part of PATH if PATH does
+ * not end with ':'. We may consider appending an extra ':' to the end of
+ * SEARCH. -- houjingyi 2013-05-24 */
+ if (start != NULL && *start != '\0') {
+ snprintf(buf, PATH_MAX + 1, "%s/%s", start, argv0);
+ if (access(buf, F_OK) == 0) {
+ free(search);
+ search = copied_realpath(buf);
+ free(buf);
+ return search;
+ }
+ }
free(search);
free(buf);
void pthreads_win32_init();
#endif
+void print_locale_variable(const char *name)
+{
+ char *value = getenv(name);
+
+ if (value) {
+ fprintf(stderr, "\n %s=%s", name, value);
+ }
+}
+
+void setup_locale()
+{
+ if(setlocale(LC_ALL, "") == NULL) {
+#ifndef LISP_FEATURE_WIN32
+
+ fprintf(stderr, "WARNING: Setting locale failed.\n");
+ fprintf(stderr, " Check the following variables for correct values:");
+
+ if (setlocale(LC_CTYPE, "") == NULL) {
+ print_locale_variable("LC_ALL");
+ print_locale_variable("LC_CTYPE");
+ print_locale_variable("LANG");
+ }
+
+ if (setlocale(LC_MESSAGES, "") == NULL) {
+ print_locale_variable("LC_MESSAGES");
+ }
+ if (setlocale(LC_COLLATE, "") == NULL) {
+ print_locale_variable("LC_COLLATE");
+ }
+ if (setlocale(LC_MONETARY, "") == NULL) {
+ print_locale_variable("LC_MONETARY");
+ }
+ if (setlocale(LC_NUMERIC, "") == NULL) {
+ print_locale_variable("LC_NUMERIC");
+ }
+ if (setlocale(LC_TIME, "") == NULL) {
+ print_locale_variable("LC_TIME");
+ }
+ fprintf(stderr, "\n");
+
+#endif
+ }
+}
+
\f
int
main(int argc, char *argv[], char *envp[])
interrupt_init();
block_blockable_signals(0, 0);
- setlocale(LC_ALL, "");
-
runtime_options = NULL;
/* Save the argv[0] derived runtime path in case
gc_init();
validate();
+ setup_locale();
+
/* If no core file was specified, look for one. */
if (!core) {
core = search_for_core();
FSHOW((stderr, "/funcalling initial_function=0x%lx\n",
(unsigned long)initial_function));
-#ifdef LISP_FEATURE_WIN32
- fprintf(stderr, "\n\
-This is experimental prerelease support for the Windows platform: use\n\
-at your own risk. \"Your Kitten of Death awaits!\"\n");
- fflush(stdout);
- fflush(stderr);
-#endif
create_initial_thread(initial_function);
- lose("CATS. CATS ARE NICE.\n");
+ lose("unexpected return from initial thread in main()\n");
return 0;
}