Skip to content

Commit 6667d9a

Browse files
Extract name from inotify events rather than whole path
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
1 parent 6595bb6 commit 6667d9a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

main.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,18 @@ let main ~root_dir ~switch_port =
479479
info "Received EOF from inotify event pipe"
480480
>>= fun () ->
481481
Shutdown.exit 1
482-
| `Ok (Created name)
483-
| `Ok (Moved (Into name)) ->
484-
create switch_port root_dir name
485-
| `Ok (Unlinked name)
486-
| `Ok (Moved (Away name)) ->
487-
destroy switch_port name
482+
| `Ok (Created path)
483+
| `Ok (Moved (Into path)) ->
484+
create switch_port root_dir (Filename.basename path)
485+
| `Ok (Unlinked path)
486+
| `Ok (Moved (Away path)) ->
487+
destroy switch_port (Filename.basename path)
488488
| `Ok (Modified _) ->
489489
return ()
490-
| `Ok (Moved (Move (a, b))) ->
491-
destroy switch_port a
490+
| `Ok (Moved (Move (path_a, path_b))) ->
491+
destroy switch_port (Filename.basename path_a)
492492
>>= fun () ->
493-
create switch_port root_dir b
493+
create switch_port root_dir (Filename.basename path_b)
494494
| `Ok Queue_overflow ->
495495
sync ~root_dir ~switch_port
496496
) >>= fun () ->

0 commit comments

Comments
 (0)