X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=0d4349671dfa6c375f223cde0f43877c41ddad71;hb=ceefe00bf8c1498dfc2118d2b3666f67f91bb956;hp=e65eb61ebc2e353fb4880b4b59260c1f9c969a73;hpb=0fdc5cc3f296db134729fe58e074c20084b99459;p=petitboot diff --git a/discover/device-handler.c b/discover/device-handler.c index e65eb61..0d43496 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include "device-handler.h" @@ -20,10 +20,6 @@ #include "udev.h" #include "paths.h" -#define MOUNT_BIN "/bin/mount" - -#define UMOUNT_BIN "/bin/umount" - struct device_handler { struct discover_server *server; @@ -33,11 +29,6 @@ struct device_handler { struct list contexts; }; -struct mount_map { - char *device_path; - char *mount_point; -}; - /** * device_handler_add - Add a device to the handler device array. */ @@ -194,7 +185,7 @@ static int mount_device(struct discover_context *ctx) pb_log("couldn't create mount directory %s: %s\n", ctx->mount_path, strerror(errno)); - argv[0] = MOUNT_BIN; + argv[0] = pb_system_apps.mount; argv[1] = ctx->device_path; argv[2] = ctx->mount_path; argv[3] = "-o"; @@ -205,7 +196,7 @@ static int mount_device(struct discover_context *ctx) /* Retry mount without ro option. */ - argv[0] = MOUNT_BIN; + argv[0] = pb_system_apps.mount; argv[1] = ctx->device_path; argv[2] = ctx->mount_path; argv[3] = NULL; @@ -236,7 +227,8 @@ static int umount_device(struct discover_context *ctx) } if (pid == 0) { - execl(UMOUNT_BIN, UMOUNT_BIN, ctx->mount_path, NULL); + execl(pb_system_apps.umount, pb_system_apps.umount, + ctx->mount_path, NULL); exit(EXIT_FAILURE); }