- Timestamp:
- Feb 17, 2015, 5:43:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_hash.c
r458 r463 1325 1325 1326 1326 SL_ENTER(_("sh_hash_init")); 1327 1328 if ( sh.flag.checkSum == SH_CHECK_INIT ) 1329 { 1330 dlog(1, FIL__, __LINE__, 1331 _("Attempt to load the baseline database during initialisation. This is an internal error, please report it to the developer.\n")); 1332 SH_ABORT; 1333 aud_exit (FIL__, __LINE__, EXIT_FAILURE); 1334 } 1327 1335 1328 1336 SH_MUTEX_LOCK(mutex_hash); … … 2157 2165 { 2158 2166 sh_file_t * p; 2159 int retval; 2160 2161 if (IsInit != 1) 2162 sh_hash_init(); 2163 2164 SH_MUTEX_LOCK(mutex_hash); 2165 p = sh_hash_have_it_int (filename); 2166 if (p) 2167 retval = p->fflags; 2168 else 2169 retval = -1; 2170 SH_MUTEX_UNLOCK(mutex_hash); 2167 int retval = 0; 2168 2169 if ( sh.flag.checkSum != SH_CHECK_INIT ) 2170 { 2171 if (IsInit != 1) 2172 sh_hash_init(); 2173 2174 SH_MUTEX_LOCK(mutex_hash); 2175 p = sh_hash_have_it_int (filename); 2176 if (p) 2177 retval = p->fflags; 2178 else 2179 retval = -1; 2180 SH_MUTEX_UNLOCK(mutex_hash); 2181 } 2171 2182 return retval; 2172 2183 } … … 2175 2186 { 2176 2187 sh_file_t * p; 2177 int retval; 2178 2179 if (IsInit != 1) 2180 sh_hash_init(); 2181 2182 SH_MUTEX_LOCK(mutex_hash); 2183 p = sh_hash_have_it_int (filename); 2184 if (p) 2185 { 2186 p->fflags = flags; 2187 retval = 0; 2188 } 2189 else 2190 retval = -1; 2191 SH_MUTEX_UNLOCK(mutex_hash); 2188 int retval = 0; 2189 2190 if ( sh.flag.checkSum != SH_CHECK_INIT ) 2191 { 2192 if (IsInit != 1) 2193 sh_hash_init(); 2194 2195 SH_MUTEX_LOCK(mutex_hash); 2196 p = sh_hash_have_it_int (filename); 2197 if (p) 2198 { 2199 p->fflags = flags; 2200 retval = 0; 2201 } 2202 else 2203 retval = -1; 2204 SH_MUTEX_UNLOCK(mutex_hash); 2205 } 2192 2206 return retval; 2193 2207 } … … 2199 2213 sh_file_t * p; 2200 2214 2201 if (IsInit != 1) 2202 sh_hash_init(); 2203 2204 SH_MUTEX_LOCK(mutex_hash); 2205 p = sh_hash_have_it_int (filename); 2206 if (p) 2207 { 2208 p->fflags |= flag_to_set; 2209 } 2210 SH_MUTEX_UNLOCK(mutex_hash); 2215 if ( sh.flag.checkSum != SH_CHECK_INIT ) 2216 { 2217 if (IsInit != 1) 2218 sh_hash_init(); 2219 2220 SH_MUTEX_LOCK(mutex_hash); 2221 p = sh_hash_have_it_int (filename); 2222 if (p) 2223 { 2224 p->fflags |= flag_to_set; 2225 } 2226 SH_MUTEX_UNLOCK(mutex_hash); 2227 } 2211 2228 return; 2212 2229 } … … 2218 2235 sh_file_t * p; 2219 2236 2220 if (IsInit != 1) 2221 sh_hash_init(); 2222 2223 SH_MUTEX_LOCK(mutex_hash); 2224 p = sh_hash_have_it_int (filename); 2225 if (p) 2226 { 2227 p->fflags &= ~flag_to_clear; 2228 } 2229 SH_MUTEX_UNLOCK(mutex_hash); 2237 if ( sh.flag.checkSum != SH_CHECK_INIT ) 2238 { 2239 if (IsInit != 1) 2240 sh_hash_init(); 2241 2242 SH_MUTEX_LOCK(mutex_hash); 2243 p = sh_hash_have_it_int (filename); 2244 if (p) 2245 { 2246 p->fflags &= ~flag_to_clear; 2247 } 2248 SH_MUTEX_UNLOCK(mutex_hash); 2249 } 2230 2250 return; 2231 2251 }
Note:
See TracChangeset
for help on using the changeset viewer.