Revision 63729c36 hw/virtio-9p.c

b/hw/virtio-9p.c
171 171
    return s->ops->mknod(&s->ctx, vs->fullname.data, &cred);
172 172
}
173 173

  
174
static int v9fs_do_mksock(V9fsState *s, V9fsString *path)
175
{
176
    return s->ops->mksock(&s->ctx, path->data);
177
}
178

  
179 174
static int v9fs_do_mkdir(V9fsState *s, V9fsCreateState *vs)
180 175
{
181 176
    FsCred cred;
......
1740 1735
    v9fs_post_create(s, vs, err);
1741 1736
}
1742 1737

  
1743
static void v9fs_create_post_mksock(V9fsState *s, V9fsCreateState *vs,
1744
                                                                int err)
1745
{
1746
    if (err) {
1747
        err = -errno;
1748
        goto out;
1749
    }
1750

  
1751
    err = v9fs_do_chmod(s, &vs->fullname, vs->perm & 0777);
1752
    v9fs_create_post_perms(s, vs, err);
1753
    return;
1754

  
1755
out:
1756
    v9fs_post_create(s, vs, err);
1757
}
1758

  
1759 1738
static void v9fs_create_post_fstat(V9fsState *s, V9fsCreateState *vs, int err)
1760 1739
{
1761 1740
    if (err) {
......
1837 1816
        err = v9fs_do_mknod(s, vs, S_IFIFO | (vs->perm & 0777), 0);
1838 1817
        v9fs_post_create(s, vs, err);
1839 1818
    } else if (vs->perm & P9_STAT_MODE_SOCKET) {
1840
        err = v9fs_do_mksock(s, &vs->fullname);
1841
        v9fs_create_post_mksock(s, vs, err);
1819
        err = v9fs_do_mknod(s, vs, S_IFSOCK | (vs->perm & 0777), 0);
1820
        v9fs_post_create(s, vs, err);
1842 1821
    } else {
1843 1822
        vs->fidp->fd = v9fs_do_open2(s, vs);
1844 1823
        v9fs_create_post_open2(s, vs, err);

Also available in: Unified diff