extern "C" void init_enigma();
extern "C" void eBaseInit(void);
extern "C" void eConsoleInit(void);
-extern void bsodFatal();
+extern void bsodFatal(const char *component);
#define SKIP_PART2
#include <lib/python/python.h>
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
return 0;
}
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
if (m_erased || m_ob->ob_refcnt <= 0)
{
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
if (m_ob->ob_refcnt == 0x7FFFFFFF)
{
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
m_file = file;
m_line = line;
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
if (m_erased || m_ob->ob_refcnt <= 0)
{
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
m_file = file;
m_line = line;
eDebug("(PyObject_CallObject(%s,%s) failed)", PyString_AS_STRING(FuncStr), PyString_AS_STRING(ArgStr));
Py_DECREF(FuncStr);
Py_DECREF(ArgStr);
- bsodFatal();
+ bsodFatal(0);
}
}
return res;
#define INFOFILE "/maintainer.info"
-void bsodFatal()
+void bsodFatal(const char *component)
{
char logfile[128];
sprintf(logfile, "/media/hdd/enigma2_crash_%u.log", (unsigned int)time(0));
char crash_emailaddr[256] = CRASH_EMAILADDR;
char crash_component[256] = "enigma2";
- while ((start = lines.find("\n File \"", start)) != std::string::npos)
+ if (component)
+ snprintf(crash_component, 256, component);
+ else
{
- start += 9;
- size_t end = lines.find("\"", start);
- if (end == std::string::npos)
- break;
- end = lines.rfind("/", end);
- if (end == std::string::npos)
- break;
- if (end - start >= (256 - strlen(INFOFILE)))
- continue;
- char filename[256];
- snprintf(filename, 256, "%s%s", lines.substr(start, end - start).c_str(), INFOFILE);
- FILE *cf = fopen(filename, "r");
- if (cf)
+ while ((start = lines.find("\n File \"", start)) != std::string::npos)
{
- fgets(crash_emailaddr, sizeof crash_emailaddr, cf);
- if (*crash_emailaddr && crash_emailaddr[strlen(crash_emailaddr)-1] == '\n')
- crash_emailaddr[strlen(crash_emailaddr)-1] = 0;
+ start += 9;
+ size_t end = lines.find("\"", start);
+ if (end == std::string::npos)
+ break;
+ end = lines.rfind("/", end);
+ if (end == std::string::npos)
+ break;
+ if (end - start >= (256 - strlen(INFOFILE)))
+ continue;
+ char filename[256];
+ snprintf(filename, 256, "%s%s", lines.substr(start, end - start).c_str(), INFOFILE);
+ FILE *cf = fopen(filename, "r");
+ if (cf)
+ {
+ fgets(crash_emailaddr, sizeof crash_emailaddr, cf);
+ if (*crash_emailaddr && crash_emailaddr[strlen(crash_emailaddr)-1] == '\n')
+ crash_emailaddr[strlen(crash_emailaddr)-1] = 0;
- fgets(crash_component, sizeof crash_component, cf);
- if (*crash_component && crash_component[strlen(crash_component)-1] == '\n')
- crash_component[strlen(crash_component)-1] = 0;
- fclose(cf);
+ fgets(crash_component, sizeof crash_component, cf);
+ if (*crash_component && crash_component[strlen(crash_component)-1] == '\n')
+ crash_component[strlen(crash_component)-1] = 0;
+ fclose(cf);
+ }
}
}
oops(uc->uc_mcontext, signum == SIGSEGV || signum == SIGABRT);
#endif
eDebug("-------");
- bsodFatal();
+ bsodFatal("enigma2, signal");
}
void bsodCatchSignals()