Skip to content

Commit e31eea9

Browse files
committed
Merge pull request #10 from simonjbeaumont/improvements
Generic fixes #1
2 parents de24e7b + 6667d9a commit e31eea9

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
BINDIR?=/tmp/
2-
MANDIR?=/tmp/
1+
BINDIR?=/usr/sbin
2+
MANDIR?=/usr/share/man
33

44
.PHONY: install uninstall clean test
55

@@ -18,13 +18,13 @@ main.1: main.native
1818
./main.native --help=groff > main.1
1919

2020
install: main.native main.1
21-
install -m 0755 main.native ${BINDIR}/xapi-script-storage
21+
install -m 0755 main.native ${BINDIR}/xapi-storage-script
2222
mkdir -p ${MANDIR}/man1
23-
install -m 0644 main.1 ${MANDIR}/man1/xapi-script-storage.1
23+
install -m 0644 main.1 ${MANDIR}/man1/xapi-storage-script.1
2424

2525
uninstall:
26-
rm -f ${BINDIR}/xapi-script-storage
27-
rm -f ${MANDIR}/man1/xapi-script-storage.1
26+
rm -f ${BINDIR}/xapi-storage-script
27+
rm -f ${MANDIR}/man1/xapi-storage-script.1
2828

2929
test:
3030
@echo No tests implemented yet

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)