networkd-wait-online-link.c revision 1c4baffc1895809bae9ac36b670af90a4cb9cd7d
124baf9a815afca02e01743867baf8319557e921kenneth_suter/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
124baf9a815afca02e01743867baf8319557e921kenneth_suter This file is part of systemd.
124baf9a815afca02e01743867baf8319557e921kenneth_suter Copyright 2014 Lennart Poettering
124baf9a815afca02e01743867baf8319557e921kenneth_suter Copyright 2014 Tom Gundersen
124baf9a815afca02e01743867baf8319557e921kenneth_suter systemd is free software; you can redistribute it and/or modify it
124baf9a815afca02e01743867baf8319557e921kenneth_suter under the terms of the GNU Lesser General Public License as published by
124baf9a815afca02e01743867baf8319557e921kenneth_suter the Free Software Foundation; either version 2.1 of the License, or
124baf9a815afca02e01743867baf8319557e921kenneth_suter (at your option) any later version.
124baf9a815afca02e01743867baf8319557e921kenneth_suter systemd is distributed in the hope that it will be useful, but
124baf9a815afca02e01743867baf8319557e921kenneth_suter WITHOUT ANY WARRANTY; without even the implied warranty of
124baf9a815afca02e01743867baf8319557e921kenneth_suter MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
124baf9a815afca02e01743867baf8319557e921kenneth_suter Lesser General Public License for more details.
124baf9a815afca02e01743867baf8319557e921kenneth_suter You should have received a copy of the GNU Lesser General Public License
124baf9a815afca02e01743867baf8319557e921kenneth_suter along with systemd; If not, see <http://www.gnu.org/licenses/>.
124baf9a815afca02e01743867baf8319557e921kenneth_suterint link_new(Manager *m, Link **ret, int ifindex, const char *ifname) {
9aa7345ed04cb0b19c9302863d6012606c67c0c6kenneth_suter r = hashmap_ensure_allocated(&m->links, NULL);
124baf9a815afca02e01743867baf8319557e921kenneth_suter r = hashmap_ensure_allocated(&m->links_by_name, &string_hash_ops);
if (!l->ifname)
return -ENOMEM;
if (ret)
*ret = l;
l = NULL;
return NULL;
if (l->manager) {
free(l);
return NULL;
const char *ifname;
assert(l);
assert(m);
char *new_ifname;
if (!new_ifname)
return -ENOMEM;
assert(l);