summaryrefslogtreecommitdiff
path: root/src/export/split_version_3.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2015-06-03 11:22:09 +0200
committerDirk Engling <erdgeist@erdgeist.org>2015-06-03 11:22:09 +0200
commita007ef1af0def1870e3af6ffed09aa67edb6b195 (patch)
tree52c47d8be43a14b3794262b9a4d4b9420076cf1d /src/export/split_version_3.c
parent59d7c59c017b41e7894ffbe026a4404d02afcfa4 (diff)
Accumulate return value of write() to finally silence warnings
Diffstat (limited to 'src/export/split_version_3.c')
-rw-r--r--src/export/split_version_3.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/export/split_version_3.c b/src/export/split_version_3.c
index 853d95d..8170a3a 100644
--- a/src/export/split_version_3.c
+++ b/src/export/split_version_3.c
@@ -8,6 +8,7 @@
8int main( int argc, char **args ) { 8int main( int argc, char **args ) {
9 char table[64], f[1024*1024]; 9 char table[64], f[1024*1024];
10 int outfiles[64], i, base = 0, fixed_columns = 0; 10 int outfiles[64], i, base = 0, fixed_columns = 0;
11 ssize_t temp = 0;
11 uint32_t *p = (uint32_t*)f; 12 uint32_t *p = (uint32_t*)f;
12 13
13 if( argc > 1 ) base = atoi( args[1] ); 14 if( argc > 1 ) base = atoi( args[1] );
@@ -49,10 +50,13 @@ int main( int argc, char **args ) {
49 off = p[file+1]; 50 off = p[file+1];
50 /* Look for end of this chunk, which is <count> strings long */ 51 /* Look for end of this chunk, which is <count> strings long */
51 for( strnr=0; strnr < count; ++strnr ) { while( f[off++] ) {}; f[off-1] = '\n'; } 52 for( strnr=0; strnr < count; ++strnr ) { while( f[off++] ) {}; f[off-1] = '\n'; }
52 (void)write( outfiles[file], f + p[file+1], off - p[file+1] ); 53 temp += write( outfiles[file], f + p[file+1], off - p[file+1] );
53 } 54 }
54 } 55 }
55 56
56 for( i=0; i<64; ++i ) close( outfiles[i] ); 57 for( i=0; i<64; ++i ) close( outfiles[i] );
58 if( !temp )
59 exit(1);
60
57 return 0; 61 return 0;
58} 62}