Skip to content

Commit 1c9d6eb

Browse files
committedSep 4, 2013
fix warnings
1 parent daa2b37 commit 1c9d6eb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎src/app/main.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ static void dumpBacktrace( unsigned int depth )
223223
if ( pipe( fd ) == 0 && fork() == 0 )
224224
{
225225
close( STDIN_FILENO ); // close stdin
226-
( void ) dup( fd[0] ); // stdin from pipe
226+
227+
// stdin from pipe
228+
if ( dup( fd[0] ) != STDIN_FILENO )
229+
QgsDebugMsg( "dup to stdin failed" );
230+
227231
close( fd[1] ); // close writing end
228232
execl( "/usr/bin/c++filt", "c++filt", ( char * ) 0 );
229233
perror( "could not start c++filt" );
@@ -234,7 +238,11 @@ static void dumpBacktrace( unsigned int depth )
234238
stderr_fd = dup( STDERR_FILENO );
235239
close( fd[0] ); // close reading end
236240
close( STDERR_FILENO ); // close stderr
237-
( void ) dup( fd[1] ); // stderr to pipe
241+
242+
// stderr to pipe
243+
if ( dup( fd[1] ) != STDERR_FILENO )
244+
QgsDebugMsg( "dup to stderr failed" );
245+
238246
close( fd[1] ); // close duped pipe
239247
}
240248

@@ -246,7 +254,8 @@ static void dumpBacktrace( unsigned int depth )
246254
{
247255
int status;
248256
close( STDERR_FILENO );
249-
( void ) dup( stderr_fd );
257+
if ( dup( stderr_fd ) != STDERR_FILENO )
258+
QgsDebugMsg( "dup to stderr failed" );
250259
close( stderr_fd );
251260
wait( &status );
252261
}

0 commit comments

Comments
 (0)
Please sign in to comment.