Beispiel #1
0
static void
test_tremove (void)
{
    Npfcall *fc, *fc2;

    if (!(fc = np_create_tremove (1)))
        msg_exit ("out of memory in %s", __FUNCTION__); 
    fc2 = _rcv_buf (fc, P9_TREMOVE, __FUNCTION__);

    assert (fc->u.tremove.fid == fc2->u.tremove.fid);

    free (fc);
    free (fc2);
}
Beispiel #2
0
int
npc_remove (Npcfid *fid)
{
	Npfcall *tc = NULL, *rc = NULL;
	int ret = -1;

	if (!(tc = np_create_tremove(fid->fid))) {
		np_uerror (ENOMEM);
		goto done;
	}
	if (fid->fsys->rpc(fid->fsys, tc, &rc) < 0)
		goto done;
	ret = 0;
done:
	npc_fid_free (fid); /* fid is no longer valid after remove */
	if (tc)
		free(tc);
	if (rc)
		free(rc);
	return ret;
}