X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/9cdb8d8556bac927d1391a859e0737d50e07d7f5..679f7827555eebb588131aebfcb9fdb959199904:/src/emacs.c diff --git a/src/emacs.c b/src/emacs.c index 89e04b12b4..fd93324de9 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1,7 +1,7 @@ /* Fully extensible Emacs, running on Unix, intended for GNU. -Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2013 - Free Software Foundation, Inc. +Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2014 Free Software +Foundation, Inc. This file is part of GNU Emacs. @@ -424,7 +424,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd) { Lisp_Object found; int yes = openp (Vexec_path, Vinvocation_name, - Vexec_suffixes, &found, make_number (X_OK)); + Vexec_suffixes, &found, make_number (X_OK), false); if (yes == 1) { /* Add /: to the front of the name @@ -749,6 +749,12 @@ main (int argc, char **argv) early as possible. (unexw32.c calls this function as well, but the additional call here is harmless.) */ cache_system_info (); +#ifdef WINDOWSNT + /* On Windows 9X, we have to load UNICOWS.DLL as early as possible, + to have non-stub implementations of APIs we need to convert file + names between UTF-8 and the system's ANSI codepage. */ + maybe_load_unicows_dll (); +#endif #endif #ifdef RUN_TIME_REMAP @@ -999,6 +1005,9 @@ main (int argc, char **argv) exit (0); } + /* Make sure IS_DAEMON starts up as false. */ + daemon_pipe[1] = 0; + if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args) || argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args)) { @@ -1099,6 +1108,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem argv[skip_args] = fdStr; + fcntl (daemon_pipe[0], F_SETFD, 0); + fcntl (daemon_pipe[1], F_SETFD, 0); execvp (argv[0], argv); emacs_perror (argv[0]); exit (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE); @@ -1115,6 +1126,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem sscanf (dname_arg, "\n%d,%d\n%s", &(daemon_pipe[0]), &(daemon_pipe[1]), dname_arg2); dname_arg = *dname_arg2 ? dname_arg2 : NULL; + fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC); } #endif /* DAEMON_MUST_EXEC */ @@ -1218,7 +1230,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem #ifdef HAVE_NS ns_pool = ns_alloc_autorelease_pool (); #ifdef NS_IMPL_GNUSTEP - /* GNUStep stupidly resets our locale settings after we made them. */ + /* GNUstep stupidly resets our locale settings after we made them. */ fixup_locale (); #endif @@ -2539,7 +2551,4 @@ libraries; only those already known by Emacs will be loaded. */); Vlibrary_cache = Qnil; staticpro (&Vlibrary_cache); #endif - - /* Make sure IS_DAEMON starts up as false. */ - daemon_pipe[1] = 0; }