Skip to content

Commit

Permalink
Sure, whatever GCC some version, cool story.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Nov 22, 2014
1 parent d7e9149 commit d7c77a0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions vm/builtin/fsevent.cpp
Expand Up @@ -119,8 +119,15 @@ namespace rubinius {

#define RBX_FSEVENT_BUF_LEN (sizeof(struct inotify_event) + RBX_FSEVENT_NAME_MAX)

struct fsevent_inotify_event {
union {
unsigned char buf[RBX_FSEVENT_BUF_LEN];
struct inotify_event event;
} u;
};

Object* FSEvent::wait_for_event(STATE) {
char buf[RBX_FSEVENT_BUF_LEN];
struct fsevent_inotify_event fsevent;
int status;

if(!watch_set_) {
Expand All @@ -129,9 +136,9 @@ namespace rubinius {
watch_set_ = false;
}

status = read(in_, buf, RBX_FSEVENT_BUF_LEN);
status = read(in_, &fsevent, RBX_FSEVENT_BUF_LEN);

if(status <= 0 || !(((struct inotify_event*)buf)->mask & IN_MODIFY)) {
if(status <= 0 || !(fsevent.u.event.mask & IN_MODIFY)) {
return cNil;
}

Expand Down

0 comments on commit d7c77a0

Please sign in to comment.