File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,19 @@ - (NSDictionary *)onRemoteInstallPackage:(NSString *)message userInfo:(NSDiction
110110 HBLogDebug (@TAG " Successfully spawned trollstorehelper with pid: %d" , pid);
111111
112112 // Wait for the process to finish
113- if (waitpid (pid, &status, 0 ) < 0 ) {
113+ int waitResult;
114+ while ((waitResult = waitpid (pid, &status, 0 )) < 0 ) {
115+ if (errno == EINTR) {
116+ // Interrupted by signal, retry
117+ continue ;
118+ }
114119 HBLogDebug (@TAG " Error waiting for trollstorehelper: %s" , strerror (errno));
115120 return @{@" error" : [NSString stringWithFormat: @" Error waiting for process: %s " , strerror (errno)]};
116121 }
117122
123+ // Clean up the package file after installation
124+ [[NSFileManager defaultManager ] removeItemAtPath: packagePath error: nil ];
125+
118126 if (!WIFEXITED (status)) {
119127 HBLogDebug (@TAG " trollstorehelper did not exit normally" );
120128 return @{@" error" : @" Process did not exit normally" };
You can’t perform that action at this time.
0 commit comments