#include <string.h>
#include <minix/com.h>
#include <minix/callnr.h>
+#include <stdlib.h>
#include "buf.h"
#include "inode.h"
* 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);
}
/*===========================================================================*
}
/*===========================================================================*
- * 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 */
-
- 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);
+ 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);
+ printf("\n");
+ (void) do_sync(); /* flush everything to the disk */
+ } else printf("VFS re-panic\n");
+ exit(1);
}
-
/*===========================================================================*
* isokendpt_f *
*===========================================================================*/