Changeset View
Changeset View
Standalone View
Standalone View
head/x11-servers/xorg-server/files/patch-config_devd.c
--- config/devd.c.orig 2015-05-19 19:41:49 UTC | --- config/devd.c.orig 2017-01-19 15:20:42 UTC | ||||
+++ config/devd.c | +++ config/devd.c | ||||
@@ -0,0 +1,531 @@ | @@ -0,0 +1,532 @@ | ||||
+/* | +/* | ||||
+ * Copyright (c) 2012 Baptiste Daroussin | + * Copyright (c) 2012 Baptiste Daroussin | ||||
+ * Copyright (c) 2013, 2014 Alex Kozlov | + * Copyright (c) 2013, 2014 Alex Kozlov | ||||
+ * Copyright (c) 2014 Robert Millan | + * Copyright (c) 2014 Robert Millan | ||||
+ * Copyright (c) 2014 Jean-Sebastien Pedron | + * Copyright (c) 2014 Jean-Sebastien Pedron | ||||
+ * | + * | ||||
+ * Permission is hereby granted, free of charge, to any person obtaining a | + * Permission is hereby granted, free of charge, to any person obtaining a | ||||
+ * copy of this software and associated documentation files (the "Software"), | + * copy of this software and associated documentation files (the "Software"), | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
+#define DEVD_EVENT_ADD '+' | +#define DEVD_EVENT_ADD '+' | ||||
+#define DEVD_EVENT_REMOVE '-' | +#define DEVD_EVENT_REMOVE '-' | ||||
+ | + | ||||
+#define RECONNECT_DELAY 5 * 1000 | +#define RECONNECT_DELAY 5 * 1000 | ||||
+ | + | ||||
+static int sock_devd; | +static int sock_devd; | ||||
+static bool is_console_kbd = false; | +static bool is_console_kbd = false; | ||||
+static bool is_kbdmux = false; | +static bool is_kbdmux = false; | ||||
+OsTimerPtr rtimer; | +static OsTimerPtr rtimer = NULL; | ||||
+ | + | ||||
+struct hw_type { | +struct hw_type { | ||||
+ const char *driver; | + const char *driver; | ||||
+ int flag; | + int flag; | ||||
+ const char *xdriver; | + const char *xdriver; | ||||
+}; | +}; | ||||
+ | + | ||||
+static struct hw_type hw_types[] = { | +static struct hw_type hw_types[] = { | ||||
▲ Show 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | |||||
+ continue; | + continue; | ||||
+ free(buf); | + free(buf); | ||||
+ return -1; | + return -1; | ||||
+ /* EOF - devd socket is lost */ | + /* EOF - devd socket is lost */ | ||||
+ } else if (ret == 0) { | + } else if (ret == 0) { | ||||
+ disconnect_devd(sock_devd); | + disconnect_devd(sock_devd); | ||||
+ rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL); | + rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL); | ||||
+ LogMessage(X_WARNING, "config/devd: devd socket is lost\n"); | + LogMessage(X_WARNING, "config/devd: devd socket is lost\n"); | ||||
+ free(buf); | |||||
+ return -1; | + return -1; | ||||
+ } | + } | ||||
+ if (c == '\n') | + if (c == '\n') | ||||
+ break; | + break; | ||||
+ | + | ||||
+ if (sz + 1 >= cap) { | + if (sz + 1 >= cap) { | ||||
+ cap *= 2; | + cap *= 2; | ||||
+ newbuf = realloc(buf, cap * sizeof(char)); | + newbuf = realloc(buf, cap * sizeof(char)); | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |