Skip to content

Commit

Permalink
Raise EM::Unsupported when pid/file watching is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Oct 27, 2009
1 parent 01dc31d commit 22978fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ext/em.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ const unsigned long EventMachine_t::WatchPid (int pid)
{
#ifdef HAVE_KQUEUE
if (!bKqueue)
throw std::runtime_error("must enable kqueue");
throw std::runtime_error("must enable kqueue (EM.kqueue=true) for pid watching support");

struct kevent event;
int kqres;
Expand Down Expand Up @@ -2104,7 +2104,7 @@ const unsigned long EventMachine_t::WatchFile (const char *fpath)

#ifdef HAVE_KQUEUE
if (!bKqueue)
throw std::runtime_error("must enable kqueue");
throw std::runtime_error("must enable kqueue (EM.kqueue=true) for file watching support");

// With kqueue we have to open the file first and use the resulting fd to register for events
wd = open(fpath, O_RDONLY);
Expand Down
4 changes: 2 additions & 2 deletions ext/rubymain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ static VALUE t_watch_filename (VALUE self, VALUE fname)
try {
return ULONG2NUM(evma_watch_filename(StringValuePtr(fname)));
} catch (std::runtime_error e) {
rb_sys_fail(e.what());
rb_raise (EM_eUnsupported, e.what());
}
}

Expand All @@ -794,7 +794,7 @@ static VALUE t_watch_pid (VALUE self, VALUE pid)
try {
return ULONG2NUM(evma_watch_pid(NUM2INT(pid)));
} catch (std::runtime_error e) {
rb_sys_fail(e.what());
rb_raise (EM_eUnsupported, e.what());
}
}

Expand Down

0 comments on commit 22978fd

Please sign in to comment.