#include <sys/ioctl.h>
#include "udev-helper.h"
-#define REMOVABLE_SLEEP_DELAY 2
-
#include "petitboot-paths.h"
+/* Define below to operate without the frontend */
+#undef USE_FAKE_SOCKET
+
+/* Delay in seconds between polling of removable devices */
+#define REMOVABLE_SLEEP_DELAY 2
+
extern struct parser native_parser;
extern struct parser yaboot_parser;
static FILE *logf;
int connect_to_socket()
{
-#if 1
+#ifndef USE_FAKE_SOCKET
int fd;
struct sockaddr_un addr;
}
return rc;
}
+
+/* convenience function for parsers */
+char *join_paths(const char *a, const char *b)
+{
+ char *full_path;
+
+ full_path = malloc(strlen(a) + strlen(b) + 2);
+
+ strcpy(full_path, a);
+ if (b[0] != '/')
+ strcat(full_path, "/");
+ strcat(full_path, b);
+
+ return full_path;
+}
+