mspdebug: exit status under cygwin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

mspdebug: exit status under cygwin

Hardy Griech
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
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: mspdebug: exit status under cygwin, more information

Hardy Griech
On 19.06.2013 08:47, Hardy Griech wrote:
:
> compiled under cygwin, mspdebug does not return the correct exit status,
> i.e. if no FET has been found success is returned.
:

For more information about this behaviour, one can read
http://www.sourceware.org/ml/cygwin-patches/2009-q4/msg00028.html

Hardy

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

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: mspdebug: exit status under cygwin

Daniel Beer-3
In reply to this post by Hardy Griech
On Wed, Jun 19, 2013 at 08:47:08AM +0200, Hardy Griech wrote:
> 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:

Hi Hardy,

Thanks for this -- just updated the git repository now.

Cheers,
Daniel

--
Daniel Beer <[hidden email]>    www.dlbeer.co.nz
IRC: inittab (Freenode)    PGP key: 2048D/160A553B

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

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users