Skip to content

Commit

Permalink
fix warnings on ignored return values
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 31, 2013
1 parent b99ff61 commit 9f8d386
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/app/main.cpp
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qtermwidget/BlockArray.cpp
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qtermwidget/k3process.cpp
Expand Up @@ -86,8 +86,8 @@ class K3ProcessPrivate
}

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

KPty *pty;

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

Expand Down Expand Up @@ -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 )
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/grass/qtermwidget/k3processcontroller.cpp
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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:
Expand Down
58 changes: 29 additions & 29 deletions src/plugins/grass/qtermwidget/kpty.cpp
Expand Up @@ -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?
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 );
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9f8d386

Please sign in to comment.