diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-03-14 09:05:56 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-03-14 09:31:34 -0400 |
commit | 315db1a8aed226a51a4cf700172249cfd10ae115 (patch) | |
tree | 4b118f45a74c715ecdb3281e8a8e3f5ee9337d80 /src/network | |
parent | fe970a8a30d611d454cb40025cfc32e29efa34e6 (diff) |
Do not return -1 (EINVAL) on allocation error
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-link.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 2650f86357..275ad97a63 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -53,10 +53,10 @@ int link_new(Manager *manager, struct udev_device *device, Link **ret) { if (link->ifindex <= 0) return -EINVAL; - r = asprintf(&link->state_file, "/run/systemd/network/links/%u", - (unsigned) link->ifindex); + r = asprintf(&link->state_file, "/run/systemd/network/links/%"PRIu64, + link->ifindex); if (r < 0) - return r; + return -ENOMEM; mac = udev_device_get_sysattr_value(device, "address"); if (mac) { @@ -1381,10 +1381,10 @@ int link_save(Link *link) { if (link->dhcp_lease) { char *lease_file; - r = asprintf(&lease_file, "/run/systemd/network/leases/%u", - (unsigned) link->ifindex); + r = asprintf(&lease_file, "/run/systemd/network/leases/%"PRIu64, + link->ifindex); if (r < 0) - return r; + return -ENOMEM; r = dhcp_lease_save(link->dhcp_lease, lease_file); if (r < 0) |