Link Here
|
160 |
size = (long)(end_pos - cur_pos); |
160 |
size = (long)(end_pos - cur_pos); |
161 |
if(size > count) |
161 |
if(size > count) |
162 |
{ |
162 |
{ |
163 |
write(outfd, cur_pos, count); |
163 |
if(write(outfd, cur_pos, count) != count) |
|
|
164 |
{ |
165 |
fprintf(stderr, "Error: unexpected end of stream\n"); |
166 |
return; |
167 |
} |
168 |
|
164 |
cur_pos +=count; |
169 |
cur_pos +=count; |
165 |
if(cur_pos == end_pos) |
170 |
if(cur_pos == end_pos) |
166 |
{ |
171 |
{ |
Link Here
|
171 |
} |
176 |
} |
172 |
else if(size > 0) |
177 |
else if(size > 0) |
173 |
{ |
178 |
{ |
174 |
write(outfd, cur_pos, size); |
179 |
if(write(outfd, cur_pos, size) != count) |
|
|
180 |
{ |
181 |
fprintf(stderr, "Error: unexpected end of stream\n"); |
182 |
return; |
183 |
} |
175 |
} |
184 |
} |
176 |
|
185 |
|
177 |
while(count) |
186 |
while(count) |