Changeset 20341 for trunk/Nebulous/nebclient
- Timestamp:
- Oct 22, 2008, 9:44:43 PM (18 years ago)
- Location:
- trunk/Nebulous/nebclient/src
- Files:
-
- 2 edited
-
nebclient.c (modified) (3 diffs)
-
nebclient.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/nebclient/src/nebclient.c
r20209 r20341 4 4 * Copyright (C) 2005 Joshua Hoblitt 5 5 * 6 * $Id: nebclient.c,v 1.5 2 2008-10-16 23:53:01 jhoblittExp $6 * $Id: nebclient.c,v 1.53 2008-10-23 07:44:43 bills Exp $ 7 7 */ 8 8 … … 247 247 248 248 locations = nebFindInstances(server, key, NULL); 249 if (!locations ) {249 if (!locations || locations->n <= 1) { 250 250 nebSetErr(server, "can not cull - not enough instances"); 251 251 … … 260 260 261 261 nebObjectInstancesFree(locations); 262 263 return true; 264 } 265 266 bool nebCullAllButOne(nebServer *server, const char *key) 267 { 268 while (nebCull(server, key)) { 269 ; 270 } 262 271 263 272 return true; -
trunk/Nebulous/nebclient/src/nebclient.h
r20209 r20341 4 4 * Copyright (C) 2005 Joshua Hoblitt 5 5 * 6 * $Id: nebclient.h,v 1.3 4 2008-10-16 23:53:01 jhoblittExp $6 * $Id: nebclient.h,v 1.35 2008-10-23 07:44:43 bills Exp $ 7 7 */ 8 8 … … 120 120 ); 121 121 122 /** Removes all but one instance from a storage object 123 * 124 * @return true on success 125 */ 126 127 bool nebCullAllButOne( 128 nebServer *server, ///< nebServer object 129 const char *key ///< storage object key (name) 130 ); 131 122 132 /** Trys to acquire a lock on a storage object 123 133 *
Note:
See TracChangeset
for help on using the changeset viewer.
