tweak to panic functions of mfs and vfs.
. print newline . when recursive panic detected, don't simply return, confusing the caller, but print a diagnostic and exit . don't call sys_exit as this may confuse PM; it should be OK to call PM exit() nowadays.
This commit is contained in:
parent
515e8216e1
commit
e8aec69c7b
2 changed files with 21 additions and 21 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <string.h>
|
||||
#include <minix/com.h>
|
||||
#include <minix/callnr.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "buf.h"
|
||||
#include "inode.h"
|
||||
|
@ -35,13 +36,15 @@ int num; /* number to go with it */
|
|||
* inconsistency is detected, e.g., a programming error or illegal value of a
|
||||
* defined constant.
|
||||
*/
|
||||
if (panicking) return; /* do not panic during a sync */
|
||||
panicking = TRUE; /* prevent another panic during the sync */
|
||||
if (!panicking) { /* do not panic during a sync */
|
||||
panicking = TRUE; /* prevent another panic during the sync */
|
||||
|
||||
printf("FS panic (%s): %s ", who, mess);
|
||||
if (num != NO_NUM) printf("%d",num);
|
||||
(void) fs_sync(); /* flush everything to the disk */
|
||||
sys_exit(SELF);
|
||||
printf("MFS panic (%s): %s ", who, mess);
|
||||
if (num != NO_NUM) printf("%d",num);
|
||||
printf("\n");
|
||||
(void) fs_sync(); /* flush everything to the disk */
|
||||
} else printf("MFS re-panic\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
|
|
|
@ -88,27 +88,24 @@ PUBLIC int no_sys()
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* panic *
|
||||
* panic *
|
||||
*===========================================================================*/
|
||||
PUBLIC void panic(who, mess, num)
|
||||
char *who; /* who caused the panic */
|
||||
char *mess; /* panic message string */
|
||||
int num; /* number to go with it */
|
||||
char *who; /* who caused the panic */
|
||||
char *mess; /* panic message string */
|
||||
int num; /* number to go with it */
|
||||
{
|
||||
/* Something awful has happened. Panics are caused when an internal
|
||||
* inconsistency is detected, e.g., a programming error or illegal value of a
|
||||
* defined constant.
|
||||
*/
|
||||
if (panicking) return; /* do not panic during a sync */
|
||||
panicking = TRUE; /* prevent another panic during the sync */
|
||||
if (!panicking) { /* do not panic during a sync */
|
||||
panicking = TRUE; /* prevent another panic during the sync */
|
||||
|
||||
printf("VFS panic (%s): %s ", who, mess);
|
||||
if (num != NO_NUM) printf("%d",num);
|
||||
(void) do_sync(); /* flush everything to the disk */
|
||||
sys_exit(SELF);
|
||||
printf("VFS panic (%s): %s ", who, mess);
|
||||
if (num != NO_NUM) printf("%d",num);
|
||||
printf("\n");
|
||||
(void) do_sync(); /* flush everything to the disk */
|
||||
} else printf("VFS re-panic\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* isokendpt_f *
|
||||
*===========================================================================*/
|
||||
|
|
Loading…
Reference in a new issue