Add ugly check
This commit is contained in:
parent
053fbd6f27
commit
7817ba2340
|
@ -68,6 +68,13 @@ bool nbio_iterate(struct nbio_t* handle)
|
||||||
|
|
||||||
void nbio_resize(struct nbio_t* handle, size_t len)
|
void nbio_resize(struct nbio_t* handle, size_t len)
|
||||||
{
|
{
|
||||||
|
if (len < handle->len)
|
||||||
|
{
|
||||||
|
/* this works perfectly fine if this check is removed, but it won't work on other nbio implementations */
|
||||||
|
/* therefore, it's blocked so nobody accidentally relies on it */
|
||||||
|
puts("ERROR - attempted file shrink operation, not implemented");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
if (ftruncate(handle->fd, len) != 0)
|
if (ftruncate(handle->fd, len) != 0)
|
||||||
{
|
{
|
||||||
puts("ERROR - couldn't resize file (ftruncate)");
|
puts("ERROR - couldn't resize file (ftruncate)");
|
||||||
|
|
Loading…
Reference in New Issue