comparison th_ioctx_mem.c @ 717:e73200c4584a

Add some error status setting in memio.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Oct 2020 12:48:37 +0200
parents 0fc5ddaccc57
children ffd97ca9dfce
comparison
equal deleted inserted replaced
716:7aee25fbc504 717:e73200c4584a
129 case SEEK_END: 129 case SEEK_END:
130 newPos = ctx->memSize + offset; 130 newPos = ctx->memSize + offset;
131 break; 131 break;
132 132
133 default: 133 default:
134 ctx->status = THERR_FSEEK;
134 return -1; 135 return -1;
135 } 136 }
136 137
137 // Set the new position 138 // Set the new position
138 ctx->memOffset = newPos; 139 ctx->memOffset = newPos;
139 140
140 // Check the new position 141 // Check the new position
141 if (newPos < 0) 142 if (newPos < 0)
143 {
144 ctx->status = THERR_FSEEK;
142 return -1; 145 return -1;
146 }
143 147
144 //if (!th_mem_realloc(ctx, newPos)) 148 //if (!th_mem_realloc(ctx, newPos))
145 // return -1; 149 // return -1;
146 150
147 return 0; 151 return 0;