about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-05 23:50:24 +0000
committerEric Wong <normalperson@yhbt.net>2011-03-05 23:50:24 +0000
commit6a205437e7070b8476b876536b6a77e6041f288e (patch)
tree4a7836e37996688a58069046df50f40ee4f93e03
parente3798a8591f753706280b71c99ac8d0f2cfa393b (diff)
downloadsleepy_penguin-6a205437e7070b8476b876536b6a77e6041f288e.tar.gz
This will fail on '\0' bytes since it's an illegal path
character.
-rw-r--r--ext/sleepy_penguin/inotify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/sleepy_penguin/inotify.c b/ext/sleepy_penguin/inotify.c
index f3a07d9..714cf3d 100644
--- a/ext/sleepy_penguin/inotify.c
+++ b/ext/sleepy_penguin/inotify.c
@@ -93,7 +93,7 @@ static VALUE s_init(int argc, VALUE *argv, VALUE klass)
 static VALUE add_watch(VALUE self, VALUE path, VALUE vmask)
 {
         int fd = my_fileno(self);
-        const char *pathname = StringValuePtr(path);
+        const char *pathname = StringValueCStr(path);
         uint32_t mask = NUM2UINT(vmask);
         int rc = inotify_add_watch(fd, pathname, mask);