Skip to content
Permalink
Browse files

fix warnings on ignored return values

  • Loading branch information
jef-n committed Mar 31, 2013
1 parent b99ff61 commit 9f8d386d3d6174f03b3862c3e8572e56e8c8cb9c
@@ -201,7 +201,7 @@ void myMessageOutput( QtMsgType type, const char *msg )
{
fprintf( stderr, "Fatal: %s\n", msg );
#if defined(linux) && !defined(ANDROID)
write( STDERR_FILENO, "Stacktrace (run through c++filt):\n", 34 );
( void ) write( STDERR_FILENO, "Stacktrace (run through c++filt):\n", 34 );
void *buffer[256];
int nptrs = backtrace( buffer, sizeof( buffer ) / sizeof( *buffer ) );
backtrace_symbols_fd( buffer, nptrs, STDERR_FILENO );
@@ -211,7 +211,7 @@ bool BlockArray::setHistorySize( size_t newsize )
else
{
decreaseBuffer( newsize );
ftruncate( ion, length*blocksize );
( void ) ftruncate( ion, length*blocksize );
size = newsize;

return true;
@@ -86,8 +86,8 @@ class K3ProcessPrivate
}

K3Process::Communication usePty;
bool addUtmp : 1;
bool useShell : 1;
bool addUtmp : 1;
bool useShell : 1;

KPty *pty;

@@ -151,7 +151,7 @@ K3Process::setupEnvironment()
}
if ( !d->wd.isEmpty() )
{
chdir( QFile::encodeName( d->wd ).data() );
( void ) chdir( QFile::encodeName( d->wd ).data() );
}
}

@@ -356,7 +356,7 @@ bool K3Process::start( RunMode runmode, Communication comm )
execvp( executable, arglist );

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

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

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

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

int status;
again:
@@ -248,22 +248,22 @@ bool KPty::open()
{
d->ttyName = ptsn;
#else
int ptyno;
if ( !ioctl( d->masterFd, TIOCGPTN, &ptyno ) )
{
d->ttyName = QByteArray( "/dev/pts/" ) + QByteArray::number( ptyno );
int ptyno;
if ( !ioctl( d->masterFd, TIOCGPTN, &ptyno ) )
{
d->ttyName = QByteArray( "/dev/pts/" ) + QByteArray::number( ptyno );
#endif
#ifdef HAVE_GRANTPT
if ( !grantpt( d->masterFd ) )
goto grantedpt;
if ( !grantpt( d->masterFd ) )
goto grantedpt;
#else

goto gotpty;
goto gotpty;
#endif
}
::close( d->masterFd );
d->masterFd = -1;
}
::close( d->masterFd );
d->masterFd = -1;
}
#endif // HAVE_PTSNAME || TIOCGPTN

// Linux device names, FIXME: Trouble on other systems?
@@ -299,8 +299,8 @@ bool KPty::open()
p = getgrnam( "wheel" );
gid_t gid = p ? p->gr_gid : getgid();

chown( d->ttyName.data(), getuid(), gid );
chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP );
( void ) chown( d->ttyName.data(), getuid(), gid );
( void ) chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP );
}
goto gotpty;
}
@@ -393,7 +393,7 @@ void KPty::close()
struct stat st;
if ( !stat( d->ttyName.data(), &st ) )
{
chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 );
( void ) chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 );
chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH );
}
}
@@ -556,29 +556,29 @@ void KPty::logout()
if (( ut = getutxline( &l_struct ) ) )
{
# else
utmpname( _PATH_UTMP );
setutent();
if (( ut = getutline( &l_struct ) ) )
{
utmpname( _PATH_UTMP );
setutent();
if (( ut = getutline( &l_struct ) ) )
{
# endif
memset( ut->ut_name, 0, sizeof( *ut->ut_name ) );
memset( ut->ut_host, 0, sizeof( *ut->ut_host ) );
memset( ut->ut_name, 0, sizeof( *ut->ut_name ) );
memset( ut->ut_host, 0, sizeof( *ut->ut_host ) );
# ifdef HAVE_STRUCT_UTMP_UT_SYSLEN
ut->ut_syslen = 0;
ut->ut_syslen = 0;
# endif
# ifdef HAVE_STRUCT_UTMP_UT_TYPE
ut->ut_type = DEAD_PROCESS;
ut->ut_type = DEAD_PROCESS;
# endif
# ifdef HAVE_UTMPX
gettimeofday( ut->ut_tv, 0 );
pututxline( ut );
}
endutxent();
gettimeofday( ut->ut_tv, 0 );
pututxline( ut );
}
endutxent();
# else
ut->ut_time = time( 0 );
pututline( ut );
}
endutent();
ut->ut_time = time( 0 );
pututline( ut );
}
endutent();
# endif
# endif
#endif

0 comments on commit 9f8d386

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