@@ -437,60 +437,6 @@ + (SSYOtherApperProcessState)stateOfPid:(pid_t)pid {
437
437
return processState ;
438
438
}
439
439
440
- + (NSInteger )majorVersionOfBundlePath : (NSString *)bundlePath {
441
- NSString * infoPlistPath = [bundlePath stringByAppendingPathComponent: @" Contents" ] ;
442
- infoPlistPath = [infoPlistPath stringByAppendingPathComponent: @" Info.plist" ] ;
443
- NSData * data = [NSData dataWithContentsOfFile: infoPlistPath] ;
444
- NSDictionary * infoDic = nil ;
445
- if (data) {
446
- NSError * error = nil ;
447
- infoDic = [NSPropertyListSerialization propertyListWithData: data
448
- options: NSPropertyListImmutable
449
- format: NULL
450
- error: &error] ;
451
- // Documentation of this method is vague, but it appears to be
452
- // better to check for error != nil than infoDic == nil.
453
- if (error) {
454
- NSLog (@" Internal Error 425-2349 %@ " , error) ;
455
- }
456
- }
457
-
458
- NSString * string ;
459
- NSInteger majorVersion ;
460
- if (infoDic) {
461
- string = [infoDic objectForKey: @" CFBundleShortVersionString" ] ;
462
- majorVersion = [string majorVersion ] ;
463
-
464
- if (majorVersion == 0 ) {
465
- string = [infoDic objectForKey: @" CFBundleVersion" ] ;
466
- majorVersion = [string majorVersion ] ;
467
- }
468
- }
469
- else {
470
- // This scheme was the only one used until BookMacster 1.6.5.
471
- // It was found that this gives an outdated answer when Firefox is updated,
472
- // until Firefox was launched and quit again.
473
- // This is due to the same bug that plagues Path Finder.
474
- // Actually, the bug is documented, in +[NSBundle bundleWithPath],
475
- // "This method allocates and initializes the returned object if there is no
476
- // existing NSBundle associated with fullPath, in which case it returns the
477
- // existing object" (which, if bundlePath has been updated since this
478
- // app launched, is going to be the old bundle). So now we only
479
- // use this scheme if all else has failed.
480
- NSBundle * bundle = [NSBundle bundleWithPath: bundlePath] ;
481
-
482
- string = [bundle objectForInfoDictionaryKey: @" CFBundleVersion" ] ;
483
- majorVersion = [string majorVersion ] ;
484
-
485
- if (majorVersion == 0 ) {
486
- string = [bundle objectForInfoDictionaryKey: @" CFBundleShortVersionString" ] ;
487
- majorVersion = [string majorVersion ] ;
488
- }
489
- }
490
-
491
- return majorVersion ;
492
- }
493
-
494
440
+ (pid_t )pidOfProcessNamed : (NSString *)processName
495
441
user : (NSString *)user {
496
442
NSArray * infos = [self pidsExecutablesFull: NO ] ;
@@ -932,7 +878,7 @@ + (void)killProcessPID:(pid_t)pid
932
878
*/
933
879
934
880
/* The following two methods, written during different years, could be
935
- refactored to use some commone code, if one would want to do the testing. */
881
+ refactored to use some common code, if one would want to do the testing. */
936
882
937
883
+ (BOOL )killThisUsersProcessWithPid : (pid_t )pid
938
884
sig : (int )sig
0 commit comments