]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Numerous fixes: patches for OS/2; core for -f ''; makefile updates.
authorPaul Smith <psmith@gnu.org>
Mon, 23 Feb 2004 06:25:54 +0000 (06:25 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 23 Feb 2004 06:25:54 +0000 (06:25 +0000)
13 files changed:
ChangeLog
Makefile.am
configure.in
doc/make.texi
job.c
main.c
maintMakefile
make.h
misc.c
tests/ChangeLog
tests/scripts/functions/origin
w32/subproc/sub_proc.c
w32/subproc/w32err.c

index 1533989036ed3081b39859945b02a1eefef69d21..56c062d59126c2e1e8fdba8120b206a7cb44f2e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2004-02-22  Paul D. Smith  <psmith@gnu.org>
+
+       * main.c (decode_switches): Require non-empty strings for all our
+       string command-line options.  Fixes Debian bug # 164165.
+
+       * configure.in: Check for stdarg.h and varargs.h.
+       * make.h (USE_VARIADIC): Set this if we can use variadic functions
+       for printing messages.
+       * misc.c: Check USE_VARIADIC instead of (obsolete) HAVE_STDVARARGS.
+       (message): Ditto.
+       (error): Ditto.
+       (fatal): Ditto.
+
+       A number of patches for OS/2 support from Andreas Buening
+       <andreas.buening@nexgo.de>:
+
+       * job.c (child_handler) [OS/2]: Allow this on OS/2 but we have to
+       disable the SIGCHLD handler.
+       (reap_children) [OS/2]: Remove special handling of job_rfd.
+       (set_child_handler_action_flags) [OS/2]: Use this function in OS/2.
+       (new_job) [OS/2]: Disable the SIGCHLD handler on OS/2.
+       * main.c (main) [OS/2]: Special handling for paths in OS/2.
+       * configure.in [OS/2]: Force SA_RESTART for OS/2.
+       * Makefile.am (check-regression): Use $(EXEEXT) for Windows-type
+       systems.
+
+2004-02-21  Paul D. Smith  <psmith@gnu.org>
+
+       * w32/subproc/sub_proc.c (process_easy) [W32]: Christoph Schulz
+       <mail@kristov.de> reports that if process_begin() fails we don't
+       handle the error condition correctly in all cases.
+       * w32/subproc/w32err.c (map_windows32_error_to_string): Make sure
+       to have a newline on the message.
+
+       * job.c (construct_command_argv_internal): Add "test" to UNIX
+       sh_cmds[].  Fixes Savannah bug # 7606.
+
 2004-02-04  Paul D. Smith  <psmith@gnu.org>
 
        * job.c (vms_handle_apos) [VMS]: Fix various string handling
index d82a6d3c6b3f37a452a3a462f401b4a68c6d832c..77ebdf6524b722ee6c2aba4ea842b4b98c3df359 100644 (file)
@@ -145,8 +145,8 @@ check-regression:
                     rm -f tests/$$f; ln -s ../srctests/$$f tests; \
                   done; fi ;; \
            esac; \
-           echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS)"; \
-           cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS); \
+           echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
+           cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
          else \
            echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
          fi; \
index 73d09ee76fbd2e7519524fd293d730c07f40fc81..d8151377cf2a513a1cd8cd831947177b3decdae0 100644 (file)
@@ -52,6 +52,9 @@ AC_HEADER_TIME
 AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
                 memory.h sys/param.h sys/time.h sys/timeb.h)
 
+# Determine what kind of variadic function calls we support
+AC_CHECK_HEADERS(stdarg.h varargs.h, break)
+
 AM_PROG_CC_C_O
 AM_PROG_CC_STDC
 AC_C_CONST
@@ -244,6 +247,12 @@ AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
       [[return SA_RESTART;]])],
     [make_cv_sa_restart=yes],
     [make_cv_sa_restart=no])])
+
+# enable make_cv_sa_restart for OS/2
+case "$host_os" in
+  os2*) make_cv_sa_restart=yes ;;
+esac
+
 if test "$make_cv_sa_restart" != no; then
   AC_DEFINE(HAVE_SA_RESTART, 1,
      [Define if <signal.h> defines the SA_RESTART constant.])
index a81e8ba2e1226fd43d8fee52a53cb40753895b4a..72701345fcc25e30bc4ca36f02492f2a907b058f 100644 (file)
@@ -1949,9 +1949,8 @@ just the search paths.
 The value of the @code{make} variable @code{VPATH} specifies a list of
 directories that @code{make} should search.  Most often, the
 directories are expected to contain prerequisite files that are not in the
-current directory; however, @code{VPATH} specifies a search list that
-@code{make} applies for all files, including files which are targets of
-rules.
+current directory; however, @code{make} uses @code{VPATH} as a search
+list for both prerequisites and targets of rules.
 
 Thus, if a file that is listed as a target or prerequisite does not exist
 in the current directory, @code{make} searches the directories listed in
@@ -6470,7 +6469,7 @@ client_LIBS = protocol
 all: $(PROGRAMS)
 
 define PROGRAM_template
- $(1): $$($(1)_OBJ) $$($(1)_LIBS:%=-l%)
+ $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
  ALL_OBJS   += $$($(1)_OBJS)
 endef
 
@@ -6600,19 +6599,18 @@ Here the redefinition takes place if @samp{$(origin bletch)} returns either
 @cindex backquotes
 @cindex shell command, function for
 
-The @code{shell} function is unlike any other function except the
+The @code{shell} function is unlike any other function other than the
 @code{wildcard} function
 (@pxref{Wildcard Function, ,The Function @code{wildcard}}) in that it
 communicates with the world outside of @code{make}.
 
 The @code{shell} function performs the same function that backquotes
-(@samp{`}) perform in most shells: it does @dfn{command expansion}.  This
-means that it takes an argument that is a shell command and returns the
-output of the command.  The only processing @code{make} does on the result,
-before substituting it into the surrounding text, is to convert each
-newline or carriage-return / newline pair to a single space.  It also
-removes the trailing (carriage-return and) newline, if it's the last
-thing in the result.@refill
+(@samp{`}) perform in most shells: it does @dfn{command expansion}.
+This means that it takes as an argument a shell command and evaluates
+to the output of the command.  The only processing @code{make} does on
+the result is to convert each newline (or carriage-return / newline
+pair) to a single space.  If there is a trailing (carriage-return
+and) newline it will simply be removed.@refill
 
 The commands run by calls to the @code{shell} function are run when the
 function calls are expanded (@pxref{Reading Makefiles, , How
diff --git a/job.c b/job.c
index 1529d293ef12126f1eaa969d9914be8a0d87b757..de5f00677bcb8b29546a98eb5d548ac11bb227c1 100644 (file)
--- a/job.c
+++ b/job.c
@@ -54,7 +54,7 @@ int batch_mode_shell = 0;
 
 #elif defined (__EMX__)
 
-const char *default_shell = "/bin/sh";
+char *default_shell = "/bin/sh";
 int batch_mode_shell = 0;
 
 #elif defined (VMS)
@@ -414,7 +414,6 @@ vms_handle_apos (char *p)
 
 static unsigned int dead_children = 0;
 
-#ifndef __EMX__ /* Don't use SIGCHLD handler on OS/2. */
 RETSIGTYPE
 child_handler (int sig)
 {
@@ -426,9 +425,15 @@ child_handler (int sig)
       job_rfd = -1;
     }
 
+#ifdef __EMX__
+  /* The signal handler must called only once! */
+  signal (SIGCHLD, SIG_DFL);
+#endif
+
+  /* This causes problems if the SIGCHLD interrupts a printf().
   DB (DB_JOBS, (_("Got a SIGCHLD; %u unreaped children.\n"), dead_children));
+  */
 }
-#endif  /* !__EMX__ */
 
 extern int shell_function_pid, shell_function_completed;
 
@@ -562,18 +567,6 @@ reap_children (int block, int err)
               /* If we have started jobs in this second, remove one.  */
               if (job_counter)
                 --job_counter;
-
-#ifdef __EMX__
-             /* the SIGCHLD handler must not be used on OS/2 because, unlike
-                on UNIX systems, it had to call wait() itself.  Therefore
-                job_rfd has to be closed here.  */
-             if (job_rfd >= 0)
-               {
-                 close (job_rfd);
-                 job_rfd = -1;
-               }
-#endif
-
            }
          else
            {
@@ -881,10 +874,6 @@ unblock_sigs (void)
 #endif
 
 #ifdef MAKE_JOBSERVER
-# ifdef __EMX__
-/* Never install the SIGCHLD handler for EMX!!! */
-#  define set_child_handler_action_flags(x)
-# else
 /* Set the child handler action flags to FLAGS.  */
 static void
 set_child_handler_action_flags (int flags)
@@ -900,7 +889,6 @@ set_child_handler_action_flags (int flags)
   sigaction (SIGCLD, &sa, NULL);
 #endif
 }
-#endif  /* !__EMX__ */
 #endif
 
 
@@ -1630,6 +1618,10 @@ new_job (struct file *file)
        set_child_handler_action_flags (0);
        got_token = read (job_rfd, &token, 1);
        saved_errno = errno;
+#ifdef __EMX__
+        /* The child handler must be turned off here.  */
+        signal (SIGCHLD, SIG_DFL);
+#endif
        set_child_handler_action_flags (SA_RESTART);
 
         /* If we got one, we're done here.  */
@@ -2750,12 +2742,12 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
   char** sh_cmds;
 #else  /* must be UNIX-ish */
   static char sh_chars[] = "#;\"*?[]&|<>(){}$`^~!";
-  static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
-                            "logout", "set", "umask", "wait", "while", "for",
-                            "case", "if", ":", ".", "break", "continue",
-                            "export", "read", "readonly", "shift", "times",
-                            "trap", "switch", 0 };
-#endif /* __MSDOS__ */
+  static char *sh_cmds[] = { ".", ":", "break", "case", "cd", "continue",
+                             "eval", "exec", "exit", "export", "for", "if",
+                             "login", "logout", "read", "readonly", "set",
+                             "shift", "switch", "test", "times", "trap",
+                             "umask", "wait", "while", 0 };
+#endif
   register int i;
   register char *p;
   register char *ap;
diff --git a/main.c b/main.c
index 7af539d3138617646799e28abc722da4dd8bfc73..96bb430bc5a7466c3c139aca847d0ee35eeb7bde 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1158,7 +1158,12 @@ main (int argc, char **argv, char **envp)
      program that uses a non-absolute name.  */
   if (current_directory[0] != '\0'
       && argv[0] != 0
-      && (argv[0][0] != '/' && (argv[0][0] == '\0' || argv[0][1] != ':')))
+      && (argv[0][0] != '/' && (argv[0][0] == '\0' || argv[0][1] != ':'))
+#ifdef __EMX__
+      /* do not prepend cwd if argv[0] contains no '/', e.g. "make" */
+      && (strchr (argv[0], '/') != 0 || strchr (argv[0], '\\') != 0)
+# endif
+      )
     argv[0] = concat (current_directory, "/", argv[0]);
 #else  /* !__MSDOS__ */
   if (current_directory[0] != '\0'
@@ -2230,6 +2235,12 @@ decode_switches (int argc, char **argv, int env)
 
                  if (optarg == 0)
                    optarg = cs->noarg_value;
+                  else if (*optarg == '\0')
+                    {
+                      error (NILF, _("the `-%c' option requires a non-empty string argument"),
+                             cs->c);
+                      bad = 1;
+                    }
 
                  sl = *(struct stringlist **) cs->value_ptr;
                  if (sl == 0)
index f08c3ccf9760371c05e473a3a6022b2f665948a2..67f3098e58fa52083888a0bdecad28513fcd20c9 100644 (file)
@@ -80,20 +80,24 @@ build.sh.in: build.template Makefile
 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
 
 CVS-CLEAN-FILES +=     $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
-                       missing build.sh.in .dep_segment po-check-?
+                       build.sh.in .deps .dep_segment ABOUT-NLS
 
 # This rule tries to clean the tree right down to how it looks when you do a
 # virgin CVS checkout.
 
+# This is potentially dangerous since it removes _ANY FILE_ that is not in
+# CVS.  Including files you might mean to add to CVS but haven't yet...
+# I only use this in subdirectories where it's unlikely we have any new
+# files.  Stil...
+cvsclean = perl -e '$$k{CVS} = 1; open(E,"< CVS/Entries") || die "CVS/Entries: $$!\n"; while (defined ($$_ = <E>)) { m%^/([^/]*)% or next; $$k{$$1} = 1; } close(E) || die "CVS/Entries: $$!\n"; opendir(D, ".") || die ".: $$!\n"; while (defined ($$_ = readdir(D))) { -f $$_ && ! exists $$k{$$_} && unlink($$_); } closedir(D) || die ".: $$!\n";'
+
 .PHONY: cvs-clean
 cvs-clean: maintainer-clean
-       -rm -f *~
-       -rm -f config/*~ config/Makefile.in config/[a-z]*
-       -rm -f po/*~ po/Makefile.in.in po/Rules-quot po/[a-z]*
-       -rm -f doc/*~ doc/Makefile.in doc/fdl.texi doc/make-stds.texi \
-               doc/texinfo.tex
-       -rm -f glob/*~ glob/Makefile.in
-       -rm -f ABOUT-NLS $(CVS-CLEAN-FILES)
+       -rm -rf *~ $(CVS-CLEAN-FILES)
+       -cd config && $(cvsclean)
+       -cd po     && $(cvsclean)
+       -cd doc    && $(cvsclean)
+       -cd glob   && $(cvsclean)
 
 
 # ----------------------------------------------------------------------
@@ -142,18 +146,13 @@ po-update:
 # The following pseudo table associates a local directory and a URL
 # with each of the files that belongs to some other package and is
 # regularly updated from the specified URL.
-#              $(srcdir)/src/ansi2knr.c
-
 
-wget_files ?= $(srcdir)/doc/texinfo.tex $(srcdir)/doc/make-stds.texi \
-             $(srcdir)/doc/fdl.texi
+wget_files ?= $(srcdir)/doc/make-stds.texi $(srcdir)/doc/fdl.texi
 
 wget-targets = $(patsubst %, get-%, $(wget_files))
 
 ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
 
-texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
-
 standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
 make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
 fdl.texi-url_prefix = $(ftp-gnu)/GNUinfo/
@@ -167,32 +166,42 @@ $(wget-targets):
          && $(WGET) $(url) -O $(target).t \
          && $(move_if_change)
 
-config-prefix = http://savannah.gnu.org/cgi-bin/viewcvs/config
-config-url = $(config-prefix)/$(patsubst get-%,%,$@)?rev=HEAD
+savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs
+viewcvs-suffix = \?rev=HEAD\&content-type=text/plain
+
+config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)$(viewcvs-suffix)
 get-config/config.guess get-config/config.sub:
        @echo $(WGET) $(config-url) -O $(target) \
          && $(WGET) $(config-url) -O $(target).t \
          && $(move_if_change)
 
+gnulib-url = $(savannah-url)/gnulib/gnulib/config/$(patsubst get-config/%,%,$@)$(viewcvs-suffix)
+
+get-config/texinfo.tex:
+       @echo $(WGET) $(gnulib-url) -O $(target) \
+         && $(WGET) $(gnulib-url) -O $(target).t \
+         && $(move_if_change)
+
 
 .PHONY: wget-update
 wget-update: $(wget-targets)
 
 
 # Updating tools via CVS.
-cvs_files ?= depcomp missing
-# config/config.guess config/config.sub
-cvs-targets = $(patsubst %, get-%, $(cvs_files))
+# cvs_files ?= depcomp missing
+# cvs-targets = $(patsubst %, get-%, $(cvs_files))
 
-automake_repo = :pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
-.PHONY: $(cvs-targets)
-$(cvs-targets):
-       $(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
-         >$(target).t \
-           && $(move_if_change)
+# automake_repo = :pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
+# .PHONY: $(cvs-targets)
+# $(cvs-targets):
+#      $(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
+#        >$(target).t \
+#          && $(move_if_change)
+
+# $(cvs-targets)
 
 .PHONY: cvs-update
-cvs-update: $(cvs-targets) get-config/config.guess get-config/config.sub
+cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub
 
 
 # --------------------- #
@@ -200,9 +209,7 @@ cvs-update: $(cvs-targets) get-config/config.guess get-config/config.sub
 # --------------------- #
 
 .PHONY: update
-update: wget-update po-update
-
-# cvs-update
+update: wget-update po-update cvs-update
 
 
 ## --------------- ##
diff --git a/make.h b/make.h
index 3fae1bff379ca82aaf9308f508e2402770a32a57..fcd0e75814b0364334e63e733d3e777f4490ae62 100644 (file)
--- a/make.h
+++ b/make.h
@@ -388,7 +388,29 @@ struct floc
 \f
 /* Fancy processing for variadic functions in both ANSI and pre-ANSI
    compilers.  */
-#if defined __STDC__ && __STDC__
+#if HAVE_STDARG_H
+#  include <stdarg.h>
+#  define VA_START(a, f)        va_start(a, f)
+#else
+#  if HAVE_VARARGS_H
+#    include <varargs.h>
+#    define VA_START(a, f)      va_start(a)
+#  endif
+#endif
+#ifndef VA_START
+  error no variadic api
+#endif
+
+/* We have to have both stdarg.h or varargs.h AND v*printf or doprnt to use
+   variadic versions of these functions.  */
+
+#if HAVE_STDARG_H || HAVE_VARARGS_H
+# if HAVE_VPRINTF || HAVE_DOPRNT
+#  define USE_VARIADIC 1
+# endif
+#endif
+
+#if __STDC__ && USE_VARIADIC
 extern void message (int prefix, const char *fmt, ...)
                      __attribute__ ((__format__ (__printf__, 2, 3)));
 extern void error (const struct floc *flocp, const char *fmt, ...)
diff --git a/misc.c b/misc.c
index 9e5a5160d9ade24a052c238a55e8694153899fcc..0832042bf4c436c602723cb1b81e8d9059931f30 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -30,9 +30,8 @@ Boston, MA 02111-1307, USA.  */
    This fancy stuff all came from GNU fileutils, except for the VA_PRINTF and
    VA_END macros used here since we have multiple print functions.  */
 
-#if HAVE_VPRINTF || HAVE_DOPRNT
-# define HAVE_STDVARARGS 1
-# if __STDC__
+#if USE_VARIADIC
+# if HAVE_STDARG_H
 #  include <stdarg.h>
 #  define VA_START(args, lastarg) va_start(args, lastarg)
 # else
@@ -46,7 +45,7 @@ Boston, MA 02111-1307, USA.  */
 # endif
 # define VA_END(args) va_end(args)
 #else
-/* # undef HAVE_STDVARARGS */
+/* We can't use any variadic interface! */
 # define va_alist a1, a2, a3, a4, a5, a6, a7, a8
 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
 # define VA_START(args, lastarg)
@@ -206,7 +205,7 @@ concat (const char *s1, const char *s2, const char *s3)
 /* Print a message on stdout.  */
 
 void
-#if __STDC__ && HAVE_STDVARARGS
+#if USE_VARIADIC
 message (int prefix, const char *fmt, ...)
 #else
 message (prefix, fmt, va_alist)
@@ -215,7 +214,7 @@ message (prefix, fmt, va_alist)
      va_dcl
 #endif
 {
-#if HAVE_STDVARARGS
+#if USE_VARIADIC
   va_list args;
 #endif
 
@@ -242,7 +241,7 @@ message (prefix, fmt, va_alist)
 /* Print an error message.  */
 
 void
-#if __STDC__ && HAVE_STDVARARGS
+#if USE_VARIADIC
 error (const struct floc *flocp, const char *fmt, ...)
 #else
 error (flocp, fmt, va_alist)
@@ -251,7 +250,7 @@ error (flocp, fmt, va_alist)
      va_dcl
 #endif
 {
-#if HAVE_STDVARARGS
+#if USE_VARIADIC
   va_list args;
 #endif
 
@@ -275,7 +274,7 @@ error (flocp, fmt, va_alist)
 /* Print an error message and exit.  */
 
 void
-#if __STDC__ && HAVE_STDVARARGS
+#if USE_VARIADIC
 fatal (const struct floc *flocp, const char *fmt, ...)
 #else
 fatal (flocp, fmt, va_alist)
@@ -284,7 +283,7 @@ fatal (flocp, fmt, va_alist)
      va_dcl
 #endif
 {
-#if HAVE_STDVARARGS
+#if USE_VARIADIC
   va_list args;
 #endif
 
index b20f46fec14624655c9183c2cba384da542c5a44..9f31f4e2e840f1abb3ac3be740d6a5193831c22f 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-21  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/functions/origin: Set our own environment variable
+       rather than relying on $HOME.
+
 2004-01-21  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/features/conditionals: Test arguments to ifn?def which
index eab2d78794c32e1dae511eac8f87a0d76e0619ae..c45a35938ad572c69d28a5b44c43532098eff3a2 100644 (file)
@@ -15,13 +15,8 @@ defined per the following list:
 'override'             defined by override in makefile
 'automatic'            Automatic variable\n";
 
-# On WIN32 systems, HOME is meaningless. SystemRoot should be defined
-# though.  With DJGPP, HOME is not guaranteed to be defined.  Use DJDIR
-# instead.
-#
-$homevar = (($port_type eq 'Windows') ? "SystemRoot"
-           : (($port_type eq 'DOS') ? "DJDIR"
-              : "HOME"));
+# Set an environment variable
+$ENV{MAKETEST} = 1;
 
 open(MAKEFILE,"> $makefile");
 
@@ -33,7 +28,7 @@ override WHITE := BLACK
 all: auto
 \t\@echo \$(origin undefined)
 \t\@echo \$(origin CC)
-\t\@echo \$(origin $homevar)
+\t\@echo \$(origin MAKETEST)
 \t\@echo \$(origin MAKE)
 \t\@echo \$(origin foo)
 \t\@echo \$(origin CFLAGS)
index 52f2fa2c84088878f7bf4dacbd2666023e90dddb..bf1e732bc0dd08fbd935b3ad0f5f2fc000db2448 100644 (file)
@@ -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 */
index afe7668f37062e0f1edb395eee3e7b280a163240..9bfa2c48a5c0b66dd3782a2e42199fe279c6e498 100644 (file)
@@ -6,18 +6,18 @@
  *\r
  * Returns:  a pointer to a static error\r
  *\r
- * Notes/Dependencies:  I got this from \r
+ * Notes/Dependencies:  I got this from\r
  *      comp.os.ms-windows.programmer.win32\r
  */\r
-char * \r
+char *\r
 map_windows32_error_to_string (DWORD ercode) {\r
 /* __declspec (thread) necessary if you will use multiple threads */\r
 __declspec (thread) static char szMessageBuffer[128];\r
\r
-       /* Fill message buffer with a default message in \r
-        * case FormatMessage fails \r
+\r
+       /* Fill message buffer with a default message in\r
+        * case FormatMessage fails\r
         */\r
-    wsprintf (szMessageBuffer, "Error %ld", ercode);\r
+    wsprintf (szMessageBuffer, "Error %ld\n", ercode);\r
 \r
        /*\r
         *  Special code for winsock error handling.\r
@@ -33,7 +33,7 @@ __declspec (thread) static char szMessageBuffer[128];
                                sizeof(szMessageBuffer),\r
                                NULL);\r
                        FreeLibrary(hModule);\r
-               } \r
+               }\r
        } else {\r
                /*\r
                 *  Default system message handling\r
@@ -48,4 +48,4 @@ __declspec (thread) static char szMessageBuffer[128];
        }\r
     return szMessageBuffer;\r
 }\r
\r
+\r