#include <talloc/talloc.h>
#include <list/list.h>
+#include <log/log.h>
#include <pb-protocol/pb-protocol.h>
#include "device-handler.h"
#include "discover-server.h"
#include "parser.h"
#include "udev.h"
-#include "log.h"
#include "paths.h"
#define MOUNT_BIN "/bin/mount"
.icon_file = "meep.png",
};
-int device_handler_get_current_devices(struct device_handler *handler,
- struct device **devices)
+int device_handler_get_current_devices(
+ struct device_handler *handler __attribute__((unused)),
+ const struct device **devices)
{
*devices = &device;
goto out_rmdir;
}
- if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+ pb_log("%s: mount failed (%d): %s\n", __func__,
+ WEXITSTATUS(status), ctx->event->device);
goto out_rmdir;
+ }
setup_device_links(ctx);
return 0;
rc = mount_device(ctx);
if (rc) {
- pb_log("mount_device failed for %s\n", event->device);
talloc_free(ctx);
return 0;
}
struct device_handler *device_handler_init(struct discover_server *server)
{
struct device_handler *handler;
- int i;
+ unsigned int i;
handler = talloc(NULL, struct device_handler);
handler->devices = NULL;
for (i = 0; i < sizeof(options) / sizeof(options[0]); i++)
list_add(&device.boot_options, &options[i].list);
+ parser_init();
+
return handler;
}