Whamcloud - gitweb
LU-6080 utils: copytool to also unregister FIFO upon signal 36/13236/2
authorBruno Faccini <bruno.faccini@intel.com>
Mon, 5 Jan 2015 16:42:05 +0000 (17:42 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 7 Jan 2015 17:14:21 +0000 (17:14 +0000)
Copytool should also call llapi_hsm_unregister_event_fifo() upon
termination signal handling, to close FIFO and also unlink it if
transient.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I61add8719004a3126aee82accb0bf1267d8eb612
Reviewed-on: http://review.whamcloud.com/13236
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lhsmtool_posix.c

index c0229d7..db0dd98 100644 (file)
@@ -1774,6 +1774,10 @@ static void handler(int signal)
         * does successfully unmount and the mount is actually gone, but the
         * mtab entry remains. So this just makes mtab happier. */
        llapi_hsm_copytool_unregister(&ctdata);
+
+       /* Also remove fifo upon signal as during normal/error exit */
+       if (opt.o_event_fifo != NULL)
+               llapi_hsm_unregister_event_fifo(opt.o_event_fifo);
        _exit(1);
 }