mirror of
https://github.com/0intro/wmii
synced 2024-12-17 17:12:57 +03:00
implemented remove in bar2 :)
This commit is contained in:
parent
ff7bfbfc02
commit
3229e51735
@ -344,6 +344,27 @@ mkstat(Stat *stat, Qid *dir, char *name, unsigned long long length, unsigned int
|
|||||||
return ixp_sizeof_stat(stat);
|
return ixp_sizeof_stat(stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
xremove(IXPServer *s, IXPConn *c)
|
||||||
|
{
|
||||||
|
Map *map = fid_to_map(c->aux, s->fcall.fid);
|
||||||
|
unsigned short i;
|
||||||
|
|
||||||
|
if(!map) {
|
||||||
|
s->errstr = "invalid fid";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
i = qpath_item(map->qid.path);
|
||||||
|
s->fcall.id = RREMOVE;
|
||||||
|
if((qpath_type(map->qid.path) == Ditem) && i && (i < nitem)) {
|
||||||
|
Item *it = item[i];
|
||||||
|
detach_item(it);
|
||||||
|
free(it);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xread(IXPServer *s, IXPConn *c)
|
xread(IXPServer *s, IXPConn *c)
|
||||||
{
|
{
|
||||||
@ -595,6 +616,7 @@ static IXPTFunc funcs[] = {
|
|||||||
{TVERSION, ixp_server_tversion},
|
{TVERSION, ixp_server_tversion},
|
||||||
{TATTACH, xattach},
|
{TATTACH, xattach},
|
||||||
{TWALK, xwalk},
|
{TWALK, xwalk},
|
||||||
|
{TREMOVE, xremove},
|
||||||
{TOPEN, xopen},
|
{TOPEN, xopen},
|
||||||
{TREAD, xread},
|
{TREAD, xread},
|
||||||
{TWRITE, xwrite},
|
{TWRITE, xwrite},
|
||||||
|
Loading…
Reference in New Issue
Block a user