Skip to content
Permalink
Browse files

fix another bunch of warnings

  • Loading branch information
jef-n committed Sep 8, 2013
1 parent 5d093f4 commit c9fe92c7c266c4c57434bd205ac3dc88b2f52e11
@@ -211,7 +211,10 @@ bool BlockArray::setHistorySize( size_t newsize )
else
{
decreaseBuffer( newsize );
( void ) ftruncate( ion, length*blocksize );
if( ftruncate( ion, length*blocksize ) < 0 )
{
perror( "ftruncate" );
}
size = newsize;

return true;
@@ -151,7 +151,8 @@ K3Process::setupEnvironment()
}
if ( !d->wd.isEmpty() )
{
( void ) chdir( QFile::encodeName( d->wd ).data() );
if( chdir( QFile::encodeName( d->wd ).data() ) < 0 )
perror( "chdir" );
}
}

@@ -334,13 +335,15 @@ bool K3Process::start( RunMode runmode, Communication comm )

if ( !runPrivileged() )
{
setgid( getgid() );
if( setgid( getgid() ) < 0 )
perror( "setgid" );
#ifdef HAVE_INITGROUPS
if ( pw )
initgroups( pw->pw_name, pw->pw_gid );
#endif
if ( geteuid() != getuid() )
setuid( getuid() );
if( setuid( getuid() ) < 0 )
perror( "setuid" );
if ( geteuid() != getuid() )
_exit( 1 );
}
@@ -356,7 +359,8 @@ bool K3Process::start( RunMode runmode, Communication comm )
execvp( executable, arglist );

char resultByte = 1;
( void ) write( fd[1], &resultByte, 1 );
if( write( fd[1], &resultByte, 1 ) < 0 )
perror( "write" );
_exit( -1 );
}
else if ( pid_ == -1 )
@@ -209,7 +209,8 @@ void K3ProcessController::theSigCHLDHandler( int arg )
int saved_errno = errno;

char dummy = 0;
( void ) ::write( instance()->d->fd[1], &dummy, 1 );
if( ::write( instance()->d->fd[1], &dummy, 1 ) < 0 )
perror( "write failed" );

#ifdef Q_OS_UNIX
if ( Private::oldChildHandlerData.sa_handler != SIG_IGN &&
@@ -243,14 +244,16 @@ K3ProcessController::rescheduleCheck()
{
d->needcheck = false;
char dummy = 0;
( void ) ::write( d->fd[1], &dummy, 1 );
if( ::write( d->fd[1], &dummy, 1 ) < 0 )
perror( "write failed" );
}
}

void K3ProcessController::slotDoHousekeeping()
{
char dummy[16]; // somewhat bigger - just in case several have queued up
( void ) ::read( d->fd[0], dummy, sizeof( dummy ) );
if( ::read( d->fd[0], dummy, sizeof( dummy ) ) < 0 )
perror( "read failed" );

int status;
again:
@@ -303,8 +303,10 @@ bool KPty::open()
p = getgrnam( "wheel" );
gid_t gid = p ? p->gr_gid : getgid();

( void ) chown( d->ttyName.data(), getuid(), gid );
( void ) chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP );
if( chown( d->ttyName.data(), getuid(), gid ) < 0 )
perror( "chown" );
if( chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP ) < 0 )
perror( "chmod" );
}
goto gotpty;
}
@@ -397,7 +399,8 @@ void KPty::close()
struct stat st;
if ( !stat( d->ttyName.data(), &st ) )
{
( void ) chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 );
if( chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 ) < 0 )
perror( "chown" );
chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH );
}
}
@@ -431,7 +431,7 @@ QgsGeometry* QgsGPXFeatureIterator::readTrackGeometry( const QgsTrack& trk )

// A track consists of several segments. Add all those segments into one.
int totalPoints = 0;;
for ( std::vector<QgsTrackSegment>::size_type i = 0; i < trk.segments.size(); i ++ )
for ( int i = 0; i < trk.segments.size(); i ++ )
{
totalPoints += trk.segments[i].points.size();
}
@@ -452,7 +452,7 @@ QgsGeometry* QgsGPXFeatureIterator::readTrackGeometry( const QgsTrack& trk )
std::memcpy( geo + 5, &totalPoints, 4 );

int thisPoint = 0;
for ( std::vector<QgsTrackSegment>::size_type k = 0; k < trk.segments.size(); k++ )
for ( int k = 0; k < trk.segments.size(); k++ )
{
int nPoints = trk.segments[k].points.size();
for ( int i = 0; i < nPoints; ++i )

0 comments on commit c9fe92c

Please sign in to comment.
You can’t perform that action at this time.