summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-SVN.txt3
-rw-r--r--src/common/core.c12
2 files changed, 10 insertions, 5 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt
index 60affd92f..519e25805 100644
--- a/Changelog-SVN.txt
+++ b/Changelog-SVN.txt
@@ -1,6 +1,9 @@
Date Added
03/09
+ * Some changes in sig_dump to allow Cygwin produce stackdumps upon crash again,
+ thanks to Ser [celest]
+ * Changed the default stackdump creation folder from /save to /log [celest]
* Fixed a typo in TXT login server logging, thanks to Skyer / eAthenaC [celest]
* Added HP and SP rate underflow checking [celest]
* Added stop auto attacking if no arrows were equipped [celest]
diff --git a/src/common/core.c b/src/common/core.c
index 948355469..37a46825b 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -9,7 +9,7 @@
#include <signal.h>
#include <string.h>
#ifdef DUMPSTACK
- #ifndef _WIN32 // HAVE_EXECINFO_H
+ #ifndef CYGWIN // HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#endif
@@ -100,6 +100,9 @@ static void sig_proc(int sn)
* Dumps the stack using glibc's backtrace
*-----------------------------------------
*/
+#ifdef CYGWIN
+ #define sig_dump SIG_DFL // allow cygwin's default dumper utility to handle this
+#else
static void sig_dump(int sn)
{
#ifdef DUMPSTACK
@@ -113,7 +116,7 @@ static void sig_dump(int sn)
// search for a usable filename
do {
- sprintf(tmp,"save/stackdump_%04d.txt", ++no);
+ sprintf(tmp,"log/stackdump_%04d.txt", ++no);
} while((fp = fopen(tmp,"r")) && (fclose(fp), no < 9999));
// dump the trace into the file
if ((fp = fopen (tmp,"w")) != NULL) {
@@ -122,11 +125,8 @@ static void sig_dump(int sn)
fprintf(fp,"Stack trace:\n");
size = backtrace (array, 20);
stack = backtrace_symbols (array, size);
-
for (no = 0; no < size; no++) {
-
fprintf(fp, "%s\n", stack[no]);
-
}
fprintf(fp,"End of stack trace\n");
@@ -134,10 +134,12 @@ static void sig_dump(int sn)
aFree(stack);
}
#endif
+ //cygwin_stackdump ();
// When pass the signal to the system's default handler
compat_signal(sn, SIG_DFL);
raise(sn);
}
+#endif
int get_svn_revision(char *svnentry) { // Warning: minor syntax checking
char line[1024];