[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: icecream/daemon
From: Stephan Kulow <coolo () kde ! org>
Date: 2006-09-03 19:29:04
Message-ID: 1157311744.561180.29609.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 580521 by coolo:
rework the logic, but it does not work yet due to SIGIGN
M +8 -11 environment.cpp
--- trunk/icecream/daemon/environment.cpp #580520:580521
@@ -357,25 +357,22 @@
fclose( fpipe );
close( fds[1] );
- int status = 0;
+ int status = 1;
+ while ( waitpid( pid, &status, 0) < 0 && errno == EINTR)
+ ;
+
+ error |= WEXITSTATUS(status);
+
if ( error ) {
kill( pid, SIGTERM );
char buffer[PATH_MAX];
snprintf( buffer, PATH_MAX, "rm -rf '/%s'", dirname.c_str() );
system( buffer );
+ return 0;
} else {
mkdir( ( dirname + "/tmp" ).c_str(), 01775 );
chown( ( dirname + "/tmp" ).c_str(), 0, nobody_gid );
chmod( ( dirname + "/tmp" ).c_str(), 01775 );
- }
-
- status = 1;
- while ( waitpid( pid, &status, 0) < 0 && errno == EINTR)
- ;
-
- if ( WEXITSTATUS(status) ) {
- return 0;
- } else {
return sumup_dir( dirname );
}
}
@@ -406,7 +403,7 @@
argv[3] = strdup( "-xf" );
argv[4] = strdup( "-" );
argv[5] = 0;
- _exit(execv( argv[0], argv ));
+ _exit( execv( argv[0], argv ) );
}
size_t remove_environment( const string &basename, const string &env )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic