diff options
author | Paul Smith <psmith@gnu.org> | 2004-02-23 06:25:54 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2004-02-23 06:25:54 +0000 |
commit | be8c3dbc974c35fac33c8392b89482c10e4f8650 (patch) | |
tree | e410b51327e62cb0dbc0a1bf2ed89fb14fd14904 /w32/subproc | |
parent | fafeb870272fd3b3623d8eb8241c915af39f5855 (diff) | |
download | gunmake-be8c3dbc974c35fac33c8392b89482c10e4f8650.tar.gz |
Numerous fixes: patches for OS/2; core for -f ''; makefile updates.
Diffstat (limited to 'w32/subproc')
-rw-r--r-- | w32/subproc/sub_proc.c | 3 | ||||
-rw-r--r-- | w32/subproc/w32err.c | 16 |
2 files changed, 11 insertions, 8 deletions
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c index 52f2fa2..bf1e732 100644 --- a/w32/subproc/sub_proc.c +++ b/w32/subproc/sub_proc.c @@ -1193,6 +1193,9 @@ process_easy( if (process_begin(hProcess, argv, envp, argv[0], NULL)) { fake_exits_pending++; + /* process_begin() failed: make a note of that. */ + if (!((sub_process*) hProcess)->last_err) + ((sub_process*) hProcess)->last_err = -1; ((sub_process*) hProcess)->exit_code = process_last_err(hProcess); /* close up unused handles */ diff --git a/w32/subproc/w32err.c b/w32/subproc/w32err.c index afe7668..9bfa2c4 100644 --- a/w32/subproc/w32err.c +++ b/w32/subproc/w32err.c @@ -6,18 +6,18 @@ *
* Returns: a pointer to a static error
*
- * Notes/Dependencies: I got this from
+ * Notes/Dependencies: I got this from
* comp.os.ms-windows.programmer.win32
*/
-char *
+char *
map_windows32_error_to_string (DWORD ercode) {
/* __declspec (thread) necessary if you will use multiple threads */
__declspec (thread) static char szMessageBuffer[128];
-
- /* Fill message buffer with a default message in
- * case FormatMessage fails
+
+ /* Fill message buffer with a default message in
+ * case FormatMessage fails
*/
- wsprintf (szMessageBuffer, "Error %ld", ercode);
+ wsprintf (szMessageBuffer, "Error %ld\n", ercode);
/*
* Special code for winsock error handling.
@@ -33,7 +33,7 @@ __declspec (thread) static char szMessageBuffer[128]; sizeof(szMessageBuffer),
NULL);
FreeLibrary(hModule);
- }
+ }
} else {
/*
* Default system message handling
@@ -48,4 +48,4 @@ __declspec (thread) static char szMessageBuffer[128]; }
return szMessageBuffer;
}
-
+
|