=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/midi.c,v retrieving revision 1.27 retrieving revision 1.28 diff -c -r1.27 -r1.28 *** src/usr.bin/sndiod/midi.c 2021/01/28 11:17:58 1.27 --- src/usr.bin/sndiod/midi.c 2021/03/08 09:42:50 1.28 *************** *** 1,4 **** ! /* $OpenBSD: midi.c,v 1.27 2021/01/28 11:17:58 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: midi.c,v 1.28 2021/03/08 09:42:50 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * *************** *** 482,488 **** struct port * port_new(char *path, unsigned int mode, int hold) { ! struct port *c; c = xmalloc(sizeof(struct port)); c->path_list = NULL; --- 482,488 ---- struct port * port_new(char *path, unsigned int mode, int hold) { ! struct port *c, **pc; c = xmalloc(sizeof(struct port)); c->path_list = NULL; *************** *** 491,498 **** c->hold = hold; c->midi = midi_new(&port_midiops, c, mode); c->num = midi_portnum++; ! c->next = port_list; ! port_list = c; return c; } --- 491,500 ---- c->hold = hold; c->midi = midi_new(&port_midiops, c, mode); c->num = midi_portnum++; ! for (pc = &port_list; *pc != NULL; pc = &(*pc)->next) ! ; ! c->next = *pc; ! *pc = c; return c; }