return value of inotify_add_watch()
inotify_add_watch may fail in udev_watch_begin, and then a link with name -1 is created.
I do not know why, but it happened once on my system:
lrwxrwxrwx 1 root root 27 Aug 4 11:27 -1 -> /devices/virtual/block/ram8
Then udev would log an error every time it was restarted:
Aug 30 04:17:20 bongo udevd[12451]: unable to move watches dir '/dev/.udev/watch', old watches will not be restored: Directory not empty
Maybe the content of the .old directory should also be deleted.
Signature · 2 lines
ciao, Marco
Quoted 9 lines · Marco d'Itri
inotify_add_watchmay fail inudev_watch_begin, and then a link with name -1 is created.
I do not know why, but it happened once on my system:lrwxrwxrwx 1 root root 27 Aug  4 11:27 -1 -> /devices/virtual/block/ram8
Then udev would log an error every time it was restarted:
Aug 30 04:17:20 bongo udevd[12451]: unable to move watches dir '/dev/.udev/watch', old watches will not be restored: Directory not empty
I changed it to give up, and not to create the link when the add fails.
Thanks,
Kay