#include #include #include #include "cpp.h" #include "str.h" #include "proc.h" #include "xmalloc.h" static size_t argv_len(char *const argv[]) { size_t len = 0; for (; argv && *argv; argv++) len++; return len; } int cpp_exec(char *in_file, char *out_file, size_t out_len, char *const argv[]) { size_t argc = 7 + argv_len(argv); char *tmp = xstrdup(in_file); char **cpp_argv; int fd, ret = -1; char *base; unsigned int i = 0; base = basename(tmp); slprintf(out_file, out_len, "/tmp/.tmp-XXXXXX-%s", base); fd = mkstemps(out_file, strlen(base) + 1); if (fd < 0) goto err; cpp_argv = xmalloc(argc * sizeof(char *)); cpp_argv[i++] = "cpp"; for (; argv && *argv; argv++, i++) cpp_argv[i] = *argv; cpp_argv[i++] = "-I"; cpp_argv[i++] = ETCDIRE_STRING; cpp_argv[i++] = "-o"; cpp_argv[i++] = out_file; cpp_argv[i++] = in_file; cpp_argv[i++] = NULL; ret = proc_exec("cpp", cpp_argv); close(fd); xfree(cpp_argv); err: xfree(tmp); return ret; } /> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoan-Adrian Ratiu <adi@adirat.com>2016-09-27 21:41:37 +0300
committerJiri Kosina <jkosina@suse.cz>2016-10-10 10:52:01 +0200
commit1bcaa05ebee115213e34f1806cc6a4f7a6175a88 (patch)
treef6fcace76897e372999d536724f2542455ad9599
parente15944099870f374ca7efc62f98cf23ba272ef43 (diff)
Revert "HID: dragonrise: fix HID Descriptor for 0x0006 PID"
This reverts commit 18339f59c3a6 ("HID: dragonrise: fix HID...") because it breaks certain dragonrise 0079:0006 gamepads. While it may fix a breakage caused by commit 79346d620e9d ("HID: input: force generic axis to be mapped to their user space axis"), it is probable that the manufacturer released different hardware with the same PID so this fix works for only a subset and breaks the other gamepads sharing the PID. What is needed is another more generic solution which fixes 79346d620e9d ("HID: input: force generic axis ...") breakage for this controller: we need to add an exception for this driver to make it keep the old behaviour previous to the initial breakage (this is done in patch 2 of this series). Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>