chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
networkd: link - drop assert from _free()
[elogind.git]
/
src
/
network
/
sd-network.c
diff --git
a/src/network/sd-network.c
b/src/network/sd-network.c
index ba13a30aec04e18f5dd5fe1932168db77e816013..3ebc5d8b13d73d7aa0b3206cd5e41e49205847fb 100644
(file)
--- a/
src/network/sd-network.c
+++ b/
src/network/sd-network.c
@@
-42,7
+42,7
@@
static int link_get_flags(unsigned index, unsigned *flags) {
assert(index);
assert(flags);
assert(index);
assert(flags);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "FLAGS", &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "FLAGS", &s, NULL);
@@
-74,7
+74,7
@@
_public_ int sd_network_get_link_state(unsigned index, char **state) {
assert_return(index, -EINVAL);
assert_return(state, -EINVAL);
assert_return(index, -EINVAL);
assert_return(state, -EINVAL);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "ADMIN_STATE", &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "ADMIN_STATE", &s, NULL);
@@
-102,7
+102,7
@@
_public_ int sd_network_get_operational_state(char **state) {
assert_return(state, -EINVAL);
assert_return(state, -EINVAL);
- r = parse_env_file("/run/systemd/net
work
/state", NEWLINE, "OPER_STATE",
+ r = parse_env_file("/run/systemd/net
if
/state", NEWLINE, "OPER_STATE",
&s, NULL);
if (r == -ENOENT)
return -ENODATA;
&s, NULL);
if (r == -ENOENT)
return -ENODATA;
@@
-124,7
+124,7
@@
_public_ int sd_network_get_link_operational_state(unsigned index, char **state)
assert_return(index, -EINVAL);
assert_return(state, -EINVAL);
assert_return(index, -EINVAL);
assert_return(state, -EINVAL);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "OPER_STATE", &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "OPER_STATE", &s, NULL);
@@
-149,7
+149,7
@@
_public_ int sd_network_get_dhcp_lease(unsigned index, sd_dhcp_lease **ret) {
assert_return(index, -EINVAL);
assert_return(ret, -EINVAL);
assert_return(index, -EINVAL);
assert_return(ret, -EINVAL);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "DHCP_LEASE", &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "DHCP_LEASE", &s, NULL);
@@
-176,7
+176,7
@@
static int network_get_in_addr(const char *key, unsigned index, struct in_addr *
assert_return(addr, -EINVAL);
assert_return(addr_size, -EINVAL);
assert_return(addr, -EINVAL);
assert_return(addr_size, -EINVAL);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, key, &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, key, &s, NULL);
@@
-204,7
+204,7
@@
static int network_get_in6_addr(const char *key, unsigned index, struct in6_addr
assert_return(addr, -EINVAL);
assert_return(addr_size, -EINVAL);
assert_return(addr, -EINVAL);
assert_return(addr_size, -EINVAL);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, key, &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, key, &s, NULL);
@@
-230,7
+230,7
@@
static int network_get_boolean(const char *key, unsigned index) {
assert_return(index, -EINVAL);
assert_return(index, -EINVAL);
- if (asprintf(&p, "/run/systemd/net
work
/links/%u", index) < 0)
+ if (asprintf(&p, "/run/systemd/net
if
/links/%u", index) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, key, &s, NULL);
return -ENOMEM;
r = parse_env_file(p, NEWLINE, key, &s, NULL);
@@
-256,7
+256,7
@@
_public_ int sd_network_get_ifindices(unsigned **indices) {
unsigned n = 0;
_cleanup_free_ uid_t *l = NULL;
unsigned n = 0;
_cleanup_free_ uid_t *l = NULL;
- d = opendir("/run/systemd/net
work
/links/");
+ d = opendir("/run/systemd/net
if
/links/");
if (!d)
return -errno;
if (!d)
return -errno;
@@
-327,7
+327,7
@@
_public_ int sd_network_monitor_new(const char *category, sd_network_monitor **m
return -errno;
if (!category || streq(category, "links")) {
return -errno;
if (!category || streq(category, "links")) {
- k = inotify_add_watch(fd, "/run/systemd/net
work
/links/", IN_MOVED_TO|IN_DELETE);
+ k = inotify_add_watch(fd, "/run/systemd/net
if
/links/", IN_MOVED_TO|IN_DELETE);
if (k < 0) {
safe_close(fd);
return -errno;
if (k < 0) {
safe_close(fd);
return -errno;
@@
-337,7
+337,7
@@
_public_ int sd_network_monitor_new(const char *category, sd_network_monitor **m
}
if (!category || streq(category, "leases")) {
}
if (!category || streq(category, "leases")) {
- k = inotify_add_watch(fd, "/run/systemd/net
work
/leases/", IN_MOVED_TO|IN_DELETE);
+ k = inotify_add_watch(fd, "/run/systemd/net
if
/leases/", IN_MOVED_TO|IN_DELETE);
if (k < 0) {
safe_close(fd);
return -errno;
if (k < 0) {
safe_close(fd);
return -errno;