stored_sig_nr = sig_nr;
}
+/* Check whether a fatal signal has occurred and, if so, call the fatal signal
+ * hooks and exit.
+ *
+ * This function is called automatically by poll_block(), but specialized
+ * programs that may not always call poll_block() on a regular basis should
+ * also call it periodically. (Therefore, any function with "block" in its
+ * name should call fatal_signal_run() each time it is called, either directly
+ * or through poll_block(), because such functions can only used by specialized
+ * programs that can afford to block outside their main loop around
+ * poll_block().)
+ */
void
fatal_signal_run(void)
{
#include "byteq.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "json.h"
#include "list.h"
#include "ofpbuf.h"
{
int error;
+ fatal_signal_run();
+
error = jsonrpc_send(rpc, msg);
if (error) {
return error;
for (;;) {
int error = jsonrpc_recv(rpc, msgp);
if (error != EAGAIN) {
+ fatal_signal_run();
return error;
}
#include "bitmap.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "json.h"
#include "jsonrpc.h"
#include "ovsdb-data.h"
{
enum ovsdb_idl_txn_status status;
+ fatal_signal_run();
while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) {
ovsdb_idl_run(txn->idl);
ovsdb_idl_wait(txn->idl);
#include <string.h>
#include "coverage.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "flow.h"
#include "ofp-print.h"
#include "ofpbuf.h"
{
struct stream *stream = *streamp;
+ fatal_signal_run();
+
while (error == EAGAIN) {
stream_run(stream);
stream_run_wait(stream);
{
int error;
+ fatal_signal_run();
while ((error = pstream_accept(pstream, new_stream)) == EAGAIN) {
pstream_wait(pstream);
poll_block();
#include <string.h>
#include "coverage.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "flow.h"
#include "ofp-print.h"
#include "ofpbuf.h"
struct vconn *vconn;
int error;
+ fatal_signal_run();
+
error = vconn_open(name, min_version, &vconn);
while (error == EAGAIN) {
vconn_run(vconn);
vconn_send_block(struct vconn *vconn, struct ofpbuf *msg)
{
int retval;
+
+ fatal_signal_run();
+
while ((retval = vconn_send(vconn, msg)) == EAGAIN) {
vconn_run(vconn);
vconn_run_wait(vconn);
vconn_recv_block(struct vconn *vconn, struct ofpbuf **msgp)
{
int retval;
+
+ fatal_signal_run();
+
while ((retval = vconn_recv(vconn, msgp)) == EAGAIN) {
vconn_run(vconn);
vconn_run_wait(vconn);