openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/base-passwd/3.5.29-r0/base-passwd-3.5.29/update-passwd.c
struct _node* copy_node(const struct _node* node)
{
    struct _node* newnode;

    newnode = create_node();
    newnode->id = node->id;
    newnode->name = node->name;
    newnode->t = node->t;

    switch (newnode->t)
    {
        case t_passwd:
            copy_passwd(newnode, &node->d.pw);
            break;
        case t_shadow:
            copy_shadow(newnode, &node->d.sp);
            break;
        case t_group:
            copy_group(newnode, &node->d.gr);
            break;
        default:
            fprintf(stderr, "Internal error: unexpected entrytype %d\n",
                    newnode->t);
            exit(1);
    }

    return newnode;
}
/* Make a copy of a list-entry
 */
Make a copy of a list-entry
Make a copy of a list - entry
struct _node* copy_node(const struct _node* node)
{
    struct _node* newnode;
    newnode = create_node();
    newnode->id = node->id;
    newnode->name = node->name;
    newnode->t = node->t;
    switch (newnode->t)
    {
        case t_passwd:
            copy_passwd(newnode, &node->d.pw);
            break;
        case t_shadow:
            copy_shadow(newnode, &node->d.sp);
            break;
        case t_group:
            copy_group(newnode, &node->d.gr);
            break;
        default:
            fprintf(stderr, "Internal error: unexpected entrytype %d\n",
                    newnode->t);
            exit(1);
    }
    return newnode;
}
struct _node * copy_node ( const struct _node * node ) { struct _node * newnode ; newnode = create_node ( ) ; newnode -> id = node -> id ; newnode -> name = node -> name ; newnode -> t = node -> t ; switch ( newnode -> t ) { case t_passwd : copy_passwd ( newnode , & node -> d . pw ) ; break ; case t_shadow : copy_shadow ( newnode , & node -> d . sp ) ; break ; case t_group : copy_group ( newnode , & node -> d . gr ) ; break ; default : fprintf ( stderr , " \n " , newnode -> t ) ; exit ( 1 ) ; } return newnode ; }
Make a copy of a list-entry
Make a copy of a list - entry