Restore SIGILL handler in machine detection code.

Patch from OpenSuSE.
This commit is contained in:
Panu Matilainen 2007-05-29 13:43:06 +03:00
parent 89e3d5c1ae
commit 768b36f1cf
1 changed files with 10 additions and 2 deletions

View File

@ -953,20 +953,28 @@ static inline int RPMClass(void)
{
int cpu;
unsigned int tfms, junk, cap, capamd;
struct sigaction oldsa;
sigaction(SIGILL, NULL, &oldsa);
signal(SIGILL, model3);
if (sigsetjmp(jenv, 1))
if (sigsetjmp(jenv, 1)) {
sigaction(SIGILL, &oldsa, NULL);
return 3;
}
if (cpuid_eax(0x000000000)==0)
if (cpuid_eax(0x000000000)==0) {
sigaction(SIGILL, &oldsa, NULL);
return 4;
}
cpuid(0x00000001, &tfms, &junk, &junk, &cap);
cpuid(0x80000001, &junk, &junk, &junk, &capamd);
cpu = (tfms>>8)&15;
sigaction(SIGILL, &oldsa, NULL);
if (cpu < 6)
return cpu;