mspdebug: exit status under cygwin

Hardy Griech <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <[email protected]>
Hi (Daniel),

compiled under cygwin, mspdebug does not return the correct exit status, 
i.e. if no FET has been found success is returned.

Small patch to solve the problem:

Index: main.c
===================================================================
--- main.c        (revision 128)
+++ main.c        (revision 129)
@@ -55,6 +55,10 @@
  #include "input_async.h"
  #include "pif.h"

+#if defined(__CYGWIN__)
+   #include <sys/cygwin.h>
+#endif
+
  #define OPT_NO_RC                0x01
  #define OPT_EMBEDDED                0x02

@@ -471,7 +475,9 @@
           * may still have a running background thread for input. If so,
           * returning from main() won't cause the process to terminate.
           */
-#if defined(__Windows__) || defined(__CYGWIN__)
+#if defined(__CYGWIN__)
+        cygwin_internal( CW_EXIT_PROCESS, (ret == 0) ? EXIT_SUCCESS : 
EXIT_FAILURE, 1 );
+#elif defined(__Windows__)
          ExitProcess(ret);
  #endif
          return ret;

Hardy

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.