Skip to content

Instantly share code, notes, and snippets.

@tjfontaine
Created December 17, 2013 18:27
Show Gist options
  • Select an option

  • Save tjfontaine/8010125 to your computer and use it in GitHub Desktop.

Select an option

Save tjfontaine/8010125 to your computer and use it in GitHub Desktop.
diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc
index 34da4b0..bf4b596 100644
--- a/src/node_watchdog.cc
+++ b/src/node_watchdog.cc
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "node_watchdog.h"
-#include <assert.h>
+#include "util.h"
namespace node {
@@ -29,24 +29,24 @@ using v8::V8;
Watchdog::Watchdog(uint64_t ms) : destroyed_(false) {
loop_ = uv_loop_new();
- if (!loop_)
- abort();
+
+ CHECK(loop_ != NULL);
int rc = uv_async_init(loop_, &async_, &Watchdog::Async);
- if (rc)
- abort();
+
+ CHECK(rc == 0);
rc = uv_timer_init(loop_, &timer_);
- if (rc)
- abort();
+
+ CHECK(rc == 0);
rc = uv_timer_start(&timer_, &Watchdog::Timer, ms, 0);
- if (rc)
- abort();
+
+ CHECK(rc == 0);
rc = uv_thread_create(&thread_, &Watchdog::Run, this);
- if (rc)
- abort();
+
+ CHECK(rc == 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment