Ticket #2185: src_servers_registrar_TRoster.cpp.diff
File src_servers_registrar_TRoster.cpp.diff, 2.3 KB (added by , 16 years ago) |
---|
-
src/servers/registrar/TRoster.cpp
76 76 //! The maximal period of time an app may be early pre-registered (60 s). 77 77 const bigtime_t kMaximalEarlyPreRegistrationPeriod = 60000000LL; 78 78 79 //! Applications living in this tree are considered "vital system apps".80 static const char *const kVitalSystemAppPathPrefix81 = "/boot/beos/system/servers";82 83 //! Applications living in this tree are considered "system apps".84 static const char *const kSystemAppPathPrefix = "/boot/beos/system";85 86 79 // get_default_roster_settings_file 87 80 /*! \brief Returns the path to the default roster settings. 88 81 \param path BPath to be set to the roster settings path. … … 93 86 get_default_roster_settings_file(BPath &path) 94 87 { 95 88 // get the path of the settings dir and append the subpath of our file 96 status_t error = find_directory(B_USER_SETTINGS_DIRECTORY, &path); 97 if (error == B_OK) 98 error = path.Append("Roster/HaikuRosterSettings"); 89 status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path); 90 if (status == B_OK) 91 status = path.Append("Roster/HaikuRosterSettings"); 92 if (status < B_OK) { 93 D(PRINT(("Composing the path failed! At %s, %s, %d.\n" 94 "Reason: %s\n", __FILE__, __PRETTY_FUNCTION__, __LINE__, 95 strerror(status)))); 96 return NULL; 97 } 99 98 100 // If some error occurred, set the standard path (can only fail, if there's101 // insufficient memory, which can't be helped anyway).102 if (error != B_OK)103 path.SetTo("/boot/home/config/settings/Roster/HaikuRosterSettings");104 105 99 return path.Path(); 106 100 } 107 101 … … 1790 1784 return false; 1791 1785 1792 1786 int len = strlen(path.Path()); 1793 int prefixLen = strlen(kSystemAppPathPrefix); 1787 BPath systemPath; 1788 status_t status = find_directory(B_BEOS_SYSTEM_DIRECTORY, &systemPath); 1789 if (status < B_OK) { 1790 D(PRINT(("find_directory() failed! At %s, %s, %d.\n" 1791 "Reason: %s\n", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1792 strerror(status)))); 1793 } 1794 1795 int prefixLen = strlen(systemPath.Path()); 1794 1796 return (len > prefixLen 1795 && strncmp(path.Path(), kSystemAppPathPrefix, prefixLen) == 0);1797 && strncmp(path.Path(), systemPath.Path(), prefixLen) == 0); 1796 1798 } 1797 1799 1798 1800 status_t