Skip to content

Commit

Permalink
Fix TMPDIR: add a slash suffix to ensure nothing breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 authored Aug 13, 2024
1 parent 7f3868c commit 99b0c31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static void overwriteExecPath(NSString *bundlePath) {
NSString *newHomePath = [NSString stringWithFormat:@"%@/Data/Application/%@", docPath, appBundle.infoDictionary[@"LCDataUUID"]];
setenv("CFFIXED_USER_HOME", newHomePath.UTF8String, 1);
setenv("HOME", newHomePath.UTF8String, 1);
setenv("TMPDIR", [@(getenv("TMPDIR")) stringByAppendingFormat:@"%@/tmp", appBundle.infoDictionary[@"LCDataUUID"]].UTF8String, 1);
setenv("TMPDIR", [@(getenv("TMPDIR")) stringByAppendingFormat:@"%@/tmp/", appBundle.infoDictionary[@"LCDataUUID"]].UTF8String, 1);
// Setup directories
NSArray *dirList = @[@"Library/Caches", @"Documents", @"SystemData"];
for (NSString *dir in dirList) {
Expand Down

1 comment on commit 99b0c31

@boa-z
Copy link

@boa-z boa-z commented on 99b0c31 Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem mentioned in #82 still exist. Unfortunately, the fix version also crashed in this build. Following are part of the error log:

Aug 13 17:15:23 JI LiveContainer(CFNetwork)[2689] <Error>: Task <F0414626-AC1D-4DFC-95D2-CF49D0528DF4>.<3> : file write to (null) failed with posix error 2
Aug 13 17:15:23 JI LiveContainer(CFNetwork)[2689] <Notice>: Task <F0414626-AC1D-4DFC-95D2-CF49D0528DF4>.<3> summary for task failure {transaction_duration_ms=340, response_status=200, connection=1, reused=1, reused_after_ms=4175, request_start_ms=1, request_duration_ms=0, response_start_ms=306, response_duration_ms=0, request_bytes=71, response_bytes=232, cache_hit=false}
Aug 13 17:15:23 JI LiveContainer(CFNetwork)[2689] <Error>: Task <F0414626-AC1D-4DFC-95D2-CF49D0528DF4>.<3> finished with error [2] Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSErrorFailingURLStringKey=<private>, NSErrorFailingURLKey=<private>, _NSURLErrorRelatedURLSessionTaskErrorKey=<private>, _NSURLErrorFailingURLSessionTaskErrorKey=<private>}

Please sign in to comment.