1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-24 18:16:24 +01:00

Change POSIX macros to avoid exit and abort

I found that the BREAK_* macros behaved differently on POSIX and in
some cases this was causing a brutal exit of POSIX meterpteter in
cases where it should just gracefully fail.

After talking to egypt, we decided to use `break` statements instead
given that's how it should function.
This commit is contained in:
OJ 2013-11-22 09:07:05 +10:00
parent 0864ef2e34
commit f3eaadd184

@ -39,16 +39,16 @@
#define WSAECONNABORTED ECONNABORTED
#define BREAK_WITH_ERROR(format, args...) \
do { \
{ \
dprintf(format, ## args); \
exit(0); \
} while(0) \
break; \
} \
#define BREAK_ON_WSAERROR(format, args...) \
do { \
{ \
dprintf(format, ## args); \
abort(); \
} while(0) \
break; \
} \
#define Sleep(x) usleep(x * 1000)
#define WSASocket(a,b,c,d,e,f) socket(a,b,c)