diff --git a/gparted.in b/gparted.in index fe22f5a3..e6c1473a 100755 --- a/gparted.in +++ b/gparted.in @@ -37,15 +37,22 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do done # -# Use devkit-disks for invocation if binary exists and daemon is running. +# Use both devkit-disks and hal-lock for invocation if both binaries exist +# and both of the daemons are running. +# Else use devkit-disks for invocation if binary exists and daemon is running. # Otherwise use hal-lock for invocation if binary exists and daemon is running. # If the above checks fail then simply run gpartedbin. # -if test "x$HAVE_DEVKIT_DISKS" = "xyes"; then - devkit-disks --inhibit -- @installdir@/gpartedbin $* +BASE_CMD="@installdir@/gpartedbin $*" +if test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then + devkit-disks --inhibit -- \ + hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \ + --run "$BASE_CMD" +elif test "x$HAVE_DEVKIT_DISKS" = "xyes"; then + devkit-disks --inhibit -- $BASE_CMD elif test "x$HAVE_HAL_LOCK" = "xyes"; then hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \ - --run "@installdir@/gpartedbin $*" + --run "$BASE_CMD" else - @installdir@/gpartedbin $* + $BASE_CMD fi