diff options
author | Timothy Pearson <[email protected]> | 2015-09-16 18:08:32 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2015-09-16 18:08:32 -0500 |
commit | 5d20ad97bffa56b2e366989e71ac9429116c017d (patch) | |
tree | 97a33e97391209289acfc1d26cd59daab1abd2d4 /tdm | |
parent | 6095bc10ad5fc08d8202e3a8f05a7998253f6e6c (diff) | |
download | tdebase-5d20ad97bffa56b2e366989e71ac9429116c017d.tar.gz tdebase-5d20ad97bffa56b2e366989e71ac9429116c017d.zip |
Fix warnings regarding return value being ignored
Diffstat (limited to 'tdm')
-rw-r--r-- | tdm/backend/client.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tdm/backend/client.c b/tdm/backend/client.c index 1dfd97849..cb185bca1 100644 --- a/tdm/backend/client.c +++ b/tdm/backend/client.c @@ -1114,7 +1114,9 @@ SetGid( const char *name, int gid ) #ifdef HAVE_INITGROUPS if (initgroups( name, gid ) < 0) { LogError( "initgroups for %s failed: %m\n", name ); - setgid( 0 ); + if (setgid(0) != 0) { + LogError("setgid(0) failed\n"); + } return 0; } #endif /* QNX4 doesn't support multi-groups, no initgroups() */ @@ -1642,7 +1644,10 @@ StartClient() } } else { cdroot: - chdir( "/" ); + if (chdir( "/" ) != 0) { + LogError( "Cannot change directory to %s\n", "/" ); + goto logerr; + } tmperr: ASPrintf( &lname, "/tmp/xerr-%s-%s", curuser, td->name ); unlink( lname ); @@ -1828,13 +1833,19 @@ ReadDmrc() exit( 0 ); if (!(data = iniLoad( fname ))) { static const int m1 = -1; - write( pfd[1], &m1, sizeof(int) ); - exit( 0 ); + if (write(pfd[1], &m1, sizeof(int)) < 0) { + return GE_Error; + } + exit(0); } len = strlen( data ); - write( pfd[1], &len, sizeof(int) ); - write( pfd[1], data, len + 1 ); - exit( 0 ); + if (write(pfd[1], &len, sizeof(int)) < 0) { + return GE_Error; + } + if (write(pfd[1], data, len + 1) < 0) { + return GE_Error; + } + exit(0); } close( pfd[1] ); free( fname ); |