revert ramfs example
the code was correct. erealloc9p() terminates the process on error, but the code was handling realloc() error explicitely and responded the request with Enomem error.
This commit is contained in:
parent
b4c3726381
commit
3a5b2189ed
2
sys/src/lib9p/ramfs.c
Normal file → Executable file
2
sys/src/lib9p/ramfs.c
Normal file → Executable file
|
@ -53,7 +53,7 @@ fswrite(Req *r)
|
||||||
count = r->ifcall.count;
|
count = r->ifcall.count;
|
||||||
|
|
||||||
if(offset+count >= rf->ndata){
|
if(offset+count >= rf->ndata){
|
||||||
v = erealloc9p(rf->data, offset+count);
|
v = realloc(rf->data, offset+count);
|
||||||
if(v == nil){
|
if(v == nil){
|
||||||
respond(r, Enomem);
|
respond(r, Enomem);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue