/*********************************************************
- * Copyright (C) 2003-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2003-2022 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
void Panic_SetCoreDumpOnPanic(Bool dumpCore);
Bool Panic_GetCoreDumpOnPanic(void);
-void Panic_SetCoreDumpFileName(const char *fileName);
int Panic_GetCoreDumpFlags(void);
void Panic_SetCoreDumpFlags(int flags);
/*********************************************************
- * Copyright (C) 2006-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2022 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
/*
* panic.c --
*
- * Module to encapsulate common Panic behaviors.
+ * Module to encapsulate common Panic behaviors.
*/
#include <stdio.h>
Bool loopOnPanic;
int coreDumpFlags; /* Memorize for clients without init func */
PanicBreakAction breakOnPanic; /* XXX: should this be DEVEL only? */
- char *coreDumpFile;
} panicState = { TRUE, TRUE }; /* defaults in lieu of Panic_Init() */
*
* Panic_SetPanicMsgPost --
*
- * Allow the Msg_Post() on panic to be suppressed. If passed FALSE,
- * then any subsequent Panics will refrain from posting the "VMWARE
- * Panic:" message.
+ * Allow the Msg_Post() on panic to be suppressed. If passed FALSE,
+ * then any subsequent Panics will refrain from posting the Panic
+ * message.
*
* Results:
- * void.
+ * None.
*
* Side effects:
- * Enables/Disables Msg_Post on Panic().
+ * None.
*
*----------------------------------------------------------------------
*/
*----------------------------------------------------------------------
*
* Panic_GetPanicMsgPost --
- * Returns panicState.msgPostOnPanic
+ *
+ * Determines whether to post a message during Panic.
*
* Results:
+ * TRUE iff it's OK to post messages during Panic.
*
* Side effects:
- * None.
+ * None.
*
*----------------------------------------------------------------------
*/
}
-/*
- *-----------------------------------------------------------------------------
- *
- * Panic_SetCoreDumpFileName --
- *
- * Record the filename of a core dump file so that a subsequent
- * Panic_PostPanicMsg can mention it by name.
- *
- * Pass NULL to say there's no core file; pass the empty string to
- * say there's a core file but you don't know where; pass the name
- * of the core file if you know it.
- *
- * Results:
- * void
- *
- * Side effects:
- * malloc; overwrites panicState.coreDumpFile
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-Panic_SetCoreDumpFileName(const char *fileName)
-{
- if (panicState.coreDumpFile) {
- free(panicState.coreDumpFile);
- }
-
- if (fileName) {
- panicState.coreDumpFile = strdup(fileName);
- } else {
- panicState.coreDumpFile = NULL;
- }
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * Panic_GetCoreDumpFileName --
- *
- * Returns the core dump filename if set.
- *
- * Results:
- * coredump filename if set, NULL otherwise.
- *
- * Side effects:
- * None
- *
- *-----------------------------------------------------------------------------
- */
-
-const char *
-Panic_GetCoreDumpFileName(void)
-{
- return panicState.coreDumpFile;
-}
-
-
/*
*-----------------------------------------------------------------------------
*
* None.
*
* Side effects:
- * Death.
+ * Death.
*
*-----------------------------------------------------------------------------
*/
/*
* Panic loop detection:
- * first time - do the whole report and shutdown sequence
- * second time - log and exit
- * beyond second time - just exit
+ * first time - do the whole report and shutdown sequence
+ * second time - log and exit
+ * beyond second time - just exit
*/
switch (count++) { // Try HARD to not put code in here!