示例#1
0
文件: zio.c 项目: surajpkn/flux-core
void zio_destroy (zio_t *z)
{
    if (z == NULL)
        return;
    assert (z->magic == ZIO_MAGIC);
    if (zio_is_in_handler (z)) {
        zio_set_destroyed (z);
        return;
    }
    if (z->buf)
        cbuf_destroy (z->buf);
    free (z->name);
    free (z->prefix);
    z->srcfd = z->dstfd = -1;
    assert (z->magic = ~ZIO_MAGIC);
    free (z);
}
示例#2
0
文件: zio.c 项目: trws/flux-core
void zio_destroy (zio_t *z)
{
    if (z == NULL)
        return;
    assert (z->magic == ZIO_MAGIC);
    if (zio_is_in_handler (z)) {
        zio_set_destroyed (z);
        return;
    }
    if (z->buf)
        cbuf_destroy (z->buf);
    free (z->name);
    free (z->prefix);
    zio_close_src_fd (z);
    zio_close_dst_fd (z);
    flux_watcher_destroy (z->reader);
    flux_watcher_destroy (z->writer);
    assert ((z->magic = ~ZIO_MAGIC));
    free (z);
}