Re: dyld: DYLD_ environment variables warnings - just annoying?
Re: dyld: DYLD_ environment variables warnings - just annoying?
- Subject: Re: dyld: DYLD_ environment variables warnings - just annoying?
- From: Jerry Krinock <email@hidden>
- Date: Tue, 04 Sep 2012 17:11:58 -0700
On 2012 Sep 04, at 06:45, Ken Thomases <email@hidden> wrote:
> You can explicitly set the environment of the task. When doing so, you can start with a copy of your main process's environment, but filter out the DYLD_* variables.
Thank you, Ken. That worked. Code below.
> Or you can simply ignore it.
Can't ignore much on 11-inch display.
> Lastly, some but not all of the things which /bin/ps can accomplish can also be accomplished through APIs like sysctl(). If you haven't already, you should consider going that route.
I've considered that before, made a note to revisit some day and make sure.
Jerry
if ([command hasSuffix:@"/ps"]) {
NSDictionary* environment = [[NSProcessInfo processInfo] environment] ;
NSMutableDictionary* taskEnvironment = [[NSMutableDictionary alloc] init] ;
for (NSString* key in environment) {
if (![key hasPrefix:@"DYLD_"]) {
[taskEnvironment setObject:[environment valueForKey:key]
forKey:key] ;
}
}
[task setEnvironment:taskEnvironment] ;
[taskEnvironment release] ;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden