diff options
Diffstat (limited to 'src/export/split_version_2.c')
-rw-r--r-- | src/export/split_version_2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/export/split_version_2.c b/src/export/split_version_2.c index 6eafe55..c14da18 100644 --- a/src/export/split_version_2.c +++ b/src/export/split_version_2.c | |||
@@ -193,6 +193,7 @@ int main( int args, char **argv ) { | |||
193 | char filename[1024]; | 193 | char filename[1024]; |
194 | MAP data, index; | 194 | MAP data, index; |
195 | uint32_t * indoff; | 195 | uint32_t * indoff; |
196 | ssize_t temp = 0; | ||
196 | size_t limit; | 197 | size_t limit; |
197 | int i; | 198 | int i; |
198 | 199 | ||
@@ -237,17 +238,19 @@ int main( int args, char **argv ) { | |||
237 | if( g_state.outfill[0] > limit ) | 238 | if( g_state.outfill[0] > limit ) |
238 | for( i=0; i<g_outfiles; ++i ) { | 239 | for( i=0; i<g_outfiles; ++i ) { |
239 | if( g_state.outfill[i] > 1024*1024*6 ) printf( "Large: %zd\n", g_state.outfill[i] ); | 240 | if( g_state.outfill[i] > 1024*1024*6 ) printf( "Large: %zd\n", g_state.outfill[i] ); |
240 | (void)write( g_state.outfiles[i], g_state.outbuf[i], g_state.outfill[i] ); | 241 | temp += write( g_state.outfiles[i], g_state.outbuf[i], g_state.outfill[i] ); |
241 | g_state.outfill[i] = 0; | 242 | g_state.outfill[i] = 0; |
242 | } | 243 | } |
243 | } | 244 | } |
244 | 245 | ||
245 | for( i=0; i<g_outfiles; ++i ) { | 246 | for( i=0; i<g_outfiles; ++i ) { |
246 | (void)write( g_state.outfiles[i], g_state.outbuf[i], g_state.outfill[i] ); | 247 | temp += write( g_state.outfiles[i], g_state.outbuf[i], g_state.outfill[i] ); |
247 | close( g_state.outfiles[i] ); | 248 | close( g_state.outfiles[i] ); |
248 | } | 249 | } |
249 | unmap_file( &data ); | 250 | unmap_file( &data ); |
250 | unmap_file( &index ); | 251 | unmap_file( &index ); |
251 | 252 | ||
253 | if( !temp ) | ||
254 | exit(1); | ||
252 | return 0; | 255 | return 0; |
253 | } | 256 | } |