mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
plugins: Use len field from inotify_event to calc dest buffer
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
f6b6ed211c
commit
43d73e3c01
1 file changed
+5
-3
+5
-3
@@ -55,12 +55,14 @@ static void setup(void)
|
|||||||
|
|
||||||
static void watcher(void *arg, int fd, int events)
|
static void watcher(void *arg, int fd, int events)
|
||||||
{
|
{
|
||||||
|
char buf[EVENT_SIZE];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
char buf[EVENT_SIZE], name[256];
|
|
||||||
struct tty *entry;
|
|
||||||
struct inotify_event *notified = (struct inotify_event *)buf;
|
|
||||||
|
|
||||||
while ((len = read(fd, buf, sizeof(buf)))) {
|
while ((len = read(fd, buf, sizeof(buf)))) {
|
||||||
|
struct inotify_event *notified = (struct inotify_event *)buf;
|
||||||
|
char name[notified->len + 6];
|
||||||
|
struct tty *entry;
|
||||||
|
|
||||||
if (-1 == len) {
|
if (-1 == len) {
|
||||||
if (errno == EINVAL)
|
if (errno == EINVAL)
|
||||||
setup();
|
setup();
|
||||||
|
|||||||
Reference in new issue
Block a user