diff options
| author | Stefan Monnier | 2010-10-15 17:55:33 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-10-15 17:55:33 -0400 |
| commit | 0c747cb143fa227e78f350ac353d703f489209df (patch) | |
| tree | 5b434055c797bd75eaa1e3d9d0773e586d44daee /src/w32proc.c | |
| parent | a01a7932080e8a6e7bc8472c58cefabcc2c37df3 (diff) | |
| parent | aa095b2db98ae149737f8de00ee733b1d257ed33 (diff) | |
| download | emacs-0c747cb143fa227e78f350ac353d703f489209df.tar.gz emacs-0c747cb143fa227e78f350ac353d703f489209df.zip | |
Merge from trunk
Diffstat (limited to 'src/w32proc.c')
| -rw-r--r-- | src/w32proc.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index ae4e725b6ef..49687574472 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -159,7 +159,7 @@ int child_proc_count = 0; | |||
| 159 | child_process child_procs[ MAX_CHILDREN ]; | 159 | child_process child_procs[ MAX_CHILDREN ]; |
| 160 | child_process *dead_child = NULL; | 160 | child_process *dead_child = NULL; |
| 161 | 161 | ||
| 162 | DWORD WINAPI reader_thread (void *arg); | 162 | static DWORD WINAPI reader_thread (void *arg); |
| 163 | 163 | ||
| 164 | /* Find an unused process slot. */ | 164 | /* Find an unused process slot. */ |
| 165 | child_process * | 165 | child_process * |
| @@ -168,7 +168,7 @@ new_child (void) | |||
| 168 | child_process *cp; | 168 | child_process *cp; |
| 169 | DWORD id; | 169 | DWORD id; |
| 170 | 170 | ||
| 171 | for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) | 171 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) |
| 172 | if (!CHILD_ACTIVE (cp)) | 172 | if (!CHILD_ACTIVE (cp)) |
| 173 | goto Initialise; | 173 | goto Initialise; |
| 174 | if (child_proc_count == MAX_CHILDREN) | 174 | if (child_proc_count == MAX_CHILDREN) |
| @@ -268,7 +268,7 @@ find_child_pid (DWORD pid) | |||
| 268 | { | 268 | { |
| 269 | child_process *cp; | 269 | child_process *cp; |
| 270 | 270 | ||
| 271 | for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) | 271 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) |
| 272 | if (CHILD_ACTIVE (cp) && pid == cp->pid) | 272 | if (CHILD_ACTIVE (cp) && pid == cp->pid) |
| 273 | return cp; | 273 | return cp; |
| 274 | return NULL; | 274 | return NULL; |
| @@ -279,7 +279,7 @@ find_child_pid (DWORD pid) | |||
| 279 | is normally blocked until woken by select() to check for input by | 279 | is normally blocked until woken by select() to check for input by |
| 280 | reading one char. When the read completes, char_avail is signaled | 280 | reading one char. When the read completes, char_avail is signaled |
| 281 | to wake up the select emulator and the thread blocks itself again. */ | 281 | to wake up the select emulator and the thread blocks itself again. */ |
| 282 | DWORD WINAPI | 282 | static DWORD WINAPI |
| 283 | reader_thread (void *arg) | 283 | reader_thread (void *arg) |
| 284 | { | 284 | { |
| 285 | child_process *cp; | 285 | child_process *cp; |
| @@ -495,7 +495,7 @@ sys_wait (int *status) | |||
| 495 | } | 495 | } |
| 496 | else | 496 | else |
| 497 | { | 497 | { |
| 498 | for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) | 498 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) |
| 499 | /* some child_procs might be sockets; ignore them */ | 499 | /* some child_procs might be sockets; ignore them */ |
| 500 | if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess | 500 | if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess |
| 501 | && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0)) | 501 | && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0)) |
| @@ -608,7 +608,7 @@ get_result: | |||
| 608 | # define IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER | 608 | # define IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER |
| 609 | #endif | 609 | #endif |
| 610 | 610 | ||
| 611 | void | 611 | static void |
| 612 | w32_executable_type (char * filename, | 612 | w32_executable_type (char * filename, |
| 613 | int * is_dos_app, | 613 | int * is_dos_app, |
| 614 | int * is_cygnus_app, | 614 | int * is_cygnus_app, |
| @@ -726,7 +726,7 @@ unwind: | |||
| 726 | close_file_data (&executable); | 726 | close_file_data (&executable); |
| 727 | } | 727 | } |
| 728 | 728 | ||
| 729 | int | 729 | static int |
| 730 | compare_env (const void *strp1, const void *strp2) | 730 | compare_env (const void *strp1, const void *strp2) |
| 731 | { | 731 | { |
| 732 | const char *str1 = *(const char **)strp1, *str2 = *(const char **)strp2; | 732 | const char *str1 = *(const char **)strp1, *str2 = *(const char **)strp2; |
| @@ -750,7 +750,7 @@ compare_env (const void *strp1, const void *strp2) | |||
| 750 | return 1; | 750 | return 1; |
| 751 | } | 751 | } |
| 752 | 752 | ||
| 753 | void | 753 | static void |
| 754 | merge_and_sort_env (char **envp1, char **envp2, char **new_envp) | 754 | merge_and_sort_env (char **envp1, char **envp2, char **new_envp) |
| 755 | { | 755 | { |
| 756 | char **optr, **nptr; | 756 | char **optr, **nptr; |
| @@ -895,7 +895,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 895 | escape_char = is_cygnus_app ? '"' : '\\'; | 895 | escape_char = is_cygnus_app ? '"' : '\\'; |
| 896 | } | 896 | } |
| 897 | 897 | ||
| 898 | /* Cygwin apps needs quoting a bit more often */ | 898 | /* Cygwin apps needs quoting a bit more often. */ |
| 899 | if (escape_char == '"') | 899 | if (escape_char == '"') |
| 900 | sepchars = "\r\n\t\f '"; | 900 | sepchars = "\r\n\t\f '"; |
| 901 | 901 | ||
| @@ -1245,7 +1245,7 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | |||
| 1245 | count_children: | 1245 | count_children: |
| 1246 | /* Add handles of child processes. */ | 1246 | /* Add handles of child processes. */ |
| 1247 | nc = 0; | 1247 | nc = 0; |
| 1248 | for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) | 1248 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) |
| 1249 | /* Some child_procs might be sockets; ignore them. Also some | 1249 | /* Some child_procs might be sockets; ignore them. Also some |
| 1250 | children may have died already, but we haven't finished reading | 1250 | children may have died already, but we haven't finished reading |
| 1251 | the process output; ignore them too. */ | 1251 | the process output; ignore them too. */ |
| @@ -1999,7 +1999,7 @@ human-readable form. */) | |||
| 1999 | return make_number (GetThreadLocale ()); | 1999 | return make_number (GetThreadLocale ()); |
| 2000 | } | 2000 | } |
| 2001 | 2001 | ||
| 2002 | DWORD | 2002 | static DWORD |
| 2003 | int_from_hex (char * s) | 2003 | int_from_hex (char * s) |
| 2004 | { | 2004 | { |
| 2005 | DWORD val = 0; | 2005 | DWORD val = 0; |
| @@ -2021,7 +2021,7 @@ int_from_hex (char * s) | |||
| 2021 | function isn't given a context pointer. */ | 2021 | function isn't given a context pointer. */ |
| 2022 | Lisp_Object Vw32_valid_locale_ids; | 2022 | Lisp_Object Vw32_valid_locale_ids; |
| 2023 | 2023 | ||
| 2024 | BOOL CALLBACK | 2024 | static BOOL CALLBACK |
| 2025 | enum_locale_fn (LPTSTR localeNum) | 2025 | enum_locale_fn (LPTSTR localeNum) |
| 2026 | { | 2026 | { |
| 2027 | DWORD id = int_from_hex (localeNum); | 2027 | DWORD id = int_from_hex (localeNum); |
| @@ -2085,7 +2085,7 @@ If successful, the new locale id is returned, otherwise nil. */) | |||
| 2085 | function isn't given a context pointer. */ | 2085 | function isn't given a context pointer. */ |
| 2086 | Lisp_Object Vw32_valid_codepages; | 2086 | Lisp_Object Vw32_valid_codepages; |
| 2087 | 2087 | ||
| 2088 | BOOL CALLBACK | 2088 | static BOOL CALLBACK |
| 2089 | enum_codepage_fn (LPTSTR codepageNum) | 2089 | enum_codepage_fn (LPTSTR codepageNum) |
| 2090 | { | 2090 | { |
| 2091 | DWORD id = atoi (codepageNum); | 2091 | DWORD id = atoi (codepageNum); |