#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; } b50d366010b219286b8c937'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel J.E. Mol <marcel@mesa.nl>2017-01-30 19:26:40 +0100
committerJohan Hovold <johan@kernel.org>2017-01-31 17:27:04 +0100
commitd07830db1bdb254e4b50d366010b219286b8c937 (patch)
tree354d7fca237fa3d7e7e63c2196eaa4e1086838ea /net/irda/irlmp_frame.c
parent5d03a2fd2292e71936c4235885c35ccc3c94695b (diff)
USB: serial: pl2303: add ATEN device ID
Seems that ATEN serial-to-usb devices using pl2303 exist with different device ids. This patch adds a missing device ID so it is recognised by the driver. Signed-off-by: Marcel J.E. Mol <marcel@mesa.nl> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'net/irda/irlmp_frame.c')