#include "cache.h" #include "util.h" #include "config.h" static const char *alias_key; static char *alias_val; static int alias_lookup_cb(const char *k, const char *v, void *cb __maybe_unused) { if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) { if (!v) return config_error_nonbool(k); alias_val = strdup(v); return 0; } return 0; } char *alias_lookup(const char *alias) { alias_key = alias; alias_val = NULL; perf_config(alias_lookup_cb, NULL); return alias_val; } int split_cmdline(char *cmdline, const char ***argv) { int src, dst, count = 0, size = 16; char quoted = 0; *argv = malloc(sizeof(char*) * size); /* split alias_string */ (*argv)[count++] = cmdline; for (src = dst = 0; cmdline[src];) { char c = cmdline[src]; if (!quoted && isspace(c)) { cmdline[dst++] = 0; while (cmdline[++src] && isspace(cmdline[src])) ; /* skip */ if (count >= size) { size += 16; *argv = realloc(*argv, sizeof(char*) * size); } (*argv)[count++] = cmdline + dst; } else if (!quoted && (c == '\'' || c == '"')) { quoted = c; src++; } else if (c == quoted) { quoted = 0; src++; } else { if (c == '\\' && quoted != '\'') { src++; c = cmdline[src]; if (!c) { zfree(argv); return error("cmdline ends with \\"); } } cmdline[dst++] = c; src++; } } cmdline[dst] = 0; if (quoted) { zfree(argv); return error("unclosed quote"); } return count; } xt plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/net/ieee802154/netlink.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-15 10:03:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-15 10:03:15 -0700
commit9ffc66941df278c9f4df979b6bcf6c6ddafedd16 (patch)
treea2cff20aafb7ecb352a0c2dd41a5430f64a248e0 /net/ieee802154/netlink.c
parent133d970e0dadf7b413db19893acc5b26664bf4a1 (diff)
parent0766f788eb727e2e330d55d30545db65bcf2623f (diff)
Merge tag 'gcc-plugins-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull gcc plugins update from Kees Cook: "This adds a new gcc plugin named "latent_entropy". It is designed to extract as much possible uncertainty from a running system at boot time as possible, hoping to capitalize on any possible variation in CPU operation (due to runtime data differences, hardware differences, SMP ordering, thermal timing variation, cache behavior, etc). At the very least, this plugin is a much more comprehensive example for how to manipulate kernel code using the gcc plugin internals" * tag 'gcc-plugins-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: latent_entropy: Mark functions with __latent_entropy gcc-plugins: Add latent_entropy plugin
Diffstat (limited to 'net/ieee802154/netlink.c')