Compare commits
No commits in common. "d06661ab664ac82f97b65e3ccb63c57c78a3b0dc" and "397288e3eb3bfb2c48d1a666754d2f0c7ac61ca0" have entirely different histories.
d06661ab66
...
397288e3eb
|
@ -689,7 +689,7 @@ int netdev_load_one(Manager *manager, const char *filename) {
|
||||||
r = config_parse_many(filename, NETWORK_DIRS, dropin_dirname,
|
r = config_parse_many(filename, NETWORK_DIRS, dropin_dirname,
|
||||||
NETDEV_COMMON_SECTIONS NETDEV_OTHER_SECTIONS,
|
NETDEV_COMMON_SECTIONS NETDEV_OTHER_SECTIONS,
|
||||||
config_item_perf_lookup, network_netdev_gperf_lookup,
|
config_item_perf_lookup, network_netdev_gperf_lookup,
|
||||||
CONFIG_PARSE_WARN, netdev_raw, NULL);
|
CONFIG_PARSE_WARN, netdev_raw);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
@ -729,7 +729,7 @@ int netdev_load_one(Manager *manager, const char *filename) {
|
||||||
r = config_parse_many(filename, NETWORK_DIRS, dropin_dirname,
|
r = config_parse_many(filename, NETWORK_DIRS, dropin_dirname,
|
||||||
NETDEV_VTABLE(netdev)->sections,
|
NETDEV_VTABLE(netdev)->sections,
|
||||||
config_item_perf_lookup, network_netdev_gperf_lookup,
|
config_item_perf_lookup, network_netdev_gperf_lookup,
|
||||||
CONFIG_PARSE_WARN, netdev, NULL);
|
CONFIG_PARSE_WARN, netdev);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,6 @@ int network_verify(Network *network) {
|
||||||
int network_load_one(Manager *manager, OrderedHashmap **networks, const char *filename) {
|
int network_load_one(Manager *manager, OrderedHashmap **networks, const char *filename) {
|
||||||
_cleanup_free_ char *fname = NULL, *name = NULL;
|
_cleanup_free_ char *fname = NULL, *name = NULL;
|
||||||
_cleanup_(network_unrefp) Network *network = NULL;
|
_cleanup_(network_unrefp) Network *network = NULL;
|
||||||
_cleanup_strv_free_ char **dropins = NULL;
|
|
||||||
_cleanup_fclose_ FILE *file = NULL;
|
_cleanup_fclose_ FILE *file = NULL;
|
||||||
const char *dropin_dirname;
|
const char *dropin_dirname;
|
||||||
char *d;
|
char *d;
|
||||||
|
@ -523,7 +522,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||||
"TokenBucketFilter\0"
|
"TokenBucketFilter\0"
|
||||||
"TrivialLinkEqualizer\0",
|
"TrivialLinkEqualizer\0",
|
||||||
config_item_perf_lookup, network_network_gperf_lookup,
|
config_item_perf_lookup, network_network_gperf_lookup,
|
||||||
CONFIG_PARSE_WARN, network, &dropins);
|
CONFIG_PARSE_WARN, network);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
@ -539,22 +538,9 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||||
network->filename);
|
network->filename);
|
||||||
|
|
||||||
struct stat stats;
|
struct stat stats;
|
||||||
if (stat(filename, &stats) >= 0)
|
if (stat(filename, &stats) < 0)
|
||||||
network->timestamp = timespec_load(&stats.st_mtim);
|
return -errno;
|
||||||
|
network->timestamp = timespec_load(&stats.st_mtim);
|
||||||
char **f;
|
|
||||||
STRV_FOREACH(f, dropins) {
|
|
||||||
usec_t t;
|
|
||||||
|
|
||||||
if (stat(*f, &stats) < 0) {
|
|
||||||
network->timestamp = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
t = timespec_load(&stats.st_mtim);
|
|
||||||
if (t > network->timestamp)
|
|
||||||
network->timestamp = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (network_verify(network) < 0)
|
if (network_verify(network) < 0)
|
||||||
/* Ignore .network files that do not match the conditions. */
|
/* Ignore .network files that do not match the conditions. */
|
||||||
|
|
|
@ -89,7 +89,7 @@ static int dnssd_service_load(Manager *manager, const char *filename) {
|
||||||
r = config_parse_many(filename, DNSSD_SERVICE_DIRS, dropin_dirname,
|
r = config_parse_many(filename, DNSSD_SERVICE_DIRS, dropin_dirname,
|
||||||
"Service\0",
|
"Service\0",
|
||||||
config_item_perf_lookup, resolved_dnssd_gperf_lookup,
|
config_item_perf_lookup, resolved_dnssd_gperf_lookup,
|
||||||
false, service, NULL);
|
false, service);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
|
|
@ -493,8 +493,7 @@ int config_parse_many(
|
||||||
ConfigItemLookup lookup,
|
ConfigItemLookup lookup,
|
||||||
const void *table,
|
const void *table,
|
||||||
ConfigParseFlags flags,
|
ConfigParseFlags flags,
|
||||||
void *userdata,
|
void *userdata) {
|
||||||
char ***ret_dropins) {
|
|
||||||
|
|
||||||
_cleanup_strv_free_ char **dropin_dirs = NULL;
|
_cleanup_strv_free_ char **dropin_dirs = NULL;
|
||||||
_cleanup_strv_free_ char **files = NULL;
|
_cleanup_strv_free_ char **files = NULL;
|
||||||
|
@ -510,14 +509,7 @@ int config_parse_many(
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = config_parse_many_files(conf_file, files, sections, lookup, table, flags, userdata);
|
return config_parse_many_files(conf_file, files, sections, lookup, table, flags, userdata);
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
if (ret_dropins)
|
|
||||||
*ret_dropins = TAKE_PTR(files);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEFINE_PARSER(type, vartype, conv_func) \
|
#define DEFINE_PARSER(type, vartype, conv_func) \
|
||||||
|
|
|
@ -107,8 +107,7 @@ int config_parse_many(
|
||||||
ConfigItemLookup lookup,
|
ConfigItemLookup lookup,
|
||||||
const void *table,
|
const void *table,
|
||||||
ConfigParseFlags flags,
|
ConfigParseFlags flags,
|
||||||
void *userdata,
|
void *userdata);
|
||||||
char ***ret_dropins); /* possibly NULL */
|
|
||||||
|
|
||||||
CONFIG_PARSER_PROTOTYPE(config_parse_int);
|
CONFIG_PARSER_PROTOTYPE(config_parse_int);
|
||||||
CONFIG_PARSER_PROTOTYPE(config_parse_unsigned);
|
CONFIG_PARSER_PROTOTYPE(config_parse_unsigned);
|
||||||
|
|
Loading…
Reference in New Issue