Changeset 746 for vendor/current/lib
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- Location:
- vendor/current/lib
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/addns/dnsmarshall.c
r740 r746 28 28 struct dns_buffer *result; 29 29 30 if (!(result = talloc (mem_ctx, struct dns_buffer))) {30 if (!(result = talloc_zero(mem_ctx, struct dns_buffer))) { 31 31 return NULL; 32 32 } … … 40 40 result->size = 2; 41 41 42 if (!(result->data = TALLOC_ ARRAY(result, uint8, result->size))) {42 if (!(result->data = TALLOC_ZERO_ARRAY(result, uint8, result->size))) { 43 43 TALLOC_FREE(result); 44 44 return NULL; … … 217 217 } 218 218 219 if (!(label = talloc (mem_ctx, struct dns_domain_label))) {219 if (!(label = talloc_zero(mem_ctx, struct dns_domain_label))) { 220 220 buf->error = ERROR_DNS_NO_MEMORY; 221 221 return; … … 224 224 label->len = len; 225 225 226 if (!(label->label = TALLOC_ ARRAY(label, char, len+1))) {226 if (!(label->label = TALLOC_ZERO_ARRAY(label, char, len+1))) { 227 227 buf->error = ERROR_DNS_NO_MEMORY; 228 228 goto error; … … 251 251 if (!ERR_DNS_IS_OK(buf->error)) return; 252 252 253 if (!(name = talloc (mem_ctx, struct dns_domain_name))) {253 if (!(name = talloc_zero(mem_ctx, struct dns_domain_name))) { 254 254 buf->error = ERROR_DNS_NO_MEMORY; 255 255 return; … … 282 282 if (!(ERR_DNS_IS_OK(buf->error))) return; 283 283 284 if (!(q = talloc (mem_ctx, struct dns_question))) {284 if (!(q = talloc_zero(mem_ctx, struct dns_question))) { 285 285 buf->error = ERROR_DNS_NO_MEMORY; 286 286 return; … … 315 315 if (!(ERR_DNS_IS_OK(buf->error))) return; 316 316 317 if (!(r = talloc (mem_ctx, struct dns_rrec))) {317 if (!(r = talloc_zero(mem_ctx, struct dns_rrec))) { 318 318 buf->error = ERROR_DNS_NO_MEMORY; 319 319 return; … … 330 330 331 331 if (r->data_length != 0) { 332 if (!(r->data = TALLOC_ ARRAY(r, uint8, r->data_length))) {332 if (!(r->data = TALLOC_ZERO_ARRAY(r, uint8, r->data_length))) { 333 333 buf->error = ERROR_DNS_NO_MEMORY; 334 334 return; … … 407 407 408 408 if ((req->num_questions != 0) && 409 !(req->questions = TALLOC_ ARRAY(req, struct dns_question *,409 !(req->questions = TALLOC_ZERO_ARRAY(req, struct dns_question *, 410 410 req->num_questions))) { 411 411 goto error; 412 412 } 413 413 if ((req->num_answers != 0) && 414 !(req->answers = TALLOC_ ARRAY(req, struct dns_rrec *,414 !(req->answers = TALLOC_ZERO_ARRAY(req, struct dns_rrec *, 415 415 req->num_answers))) { 416 416 goto error; 417 417 } 418 418 if ((req->num_auths != 0) && 419 !(req->auths = TALLOC_ ARRAY(req, struct dns_rrec *,419 !(req->auths = TALLOC_ZERO_ARRAY(req, struct dns_rrec *, 420 420 req->num_auths))) { 421 421 goto error; 422 422 } 423 423 if ((req->num_additionals != 0) && 424 !(req->additionals = TALLOC_ ARRAY(req, struct dns_rrec *,424 !(req->additionals = TALLOC_ZERO_ARRAY(req, struct dns_rrec *, 425 425 req->num_additionals))) { 426 426 goto error; -
vendor/current/lib/addns/dnsrecord.c
r740 r746 28 28 struct dns_request **preq ) 29 29 { 30 struct dns_request *req ;31 struct dns_question *q ;30 struct dns_request *req = NULL; 31 struct dns_question *q = NULL; 32 32 DNS_ERROR err; 33 33 … … 61 61 struct dns_update_request **preq ) 62 62 { 63 struct dns_update_request *req ;64 struct dns_zone *z ;63 struct dns_update_request *req = NULL; 64 struct dns_zone *z = NULL; 65 65 DNS_ERROR err; 66 66 … … 96 96 struct dns_rrec **prec) 97 97 { 98 struct dns_rrec *rec ;98 struct dns_rrec *rec = NULL; 99 99 DNS_ERROR err; 100 100 … … 182 182 struct dns_rrec **prec) 183 183 { 184 struct dns_buffer *buf ;185 struct dns_domain_name *algorithm ;184 struct dns_buffer *buf = NULL; 185 struct dns_domain_name *algorithm = NULL; 186 186 DNS_ERROR err; 187 187 … … 218 218 struct dns_tkey_record **ptkey) 219 219 { 220 struct dns_tkey_record *tkey ;220 struct dns_tkey_record *tkey = NULL; 221 221 struct dns_buffer buf; 222 222 uint32 tmp_inception, tmp_expiration; … … 270 270 struct dns_rrec **prec) 271 271 { 272 struct dns_buffer *buf ;273 struct dns_domain_name *algorithm ;272 struct dns_buffer *buf = NULL; 273 struct dns_domain_name *algorithm = NULL; 274 274 DNS_ERROR err; 275 275 … … 332 332 struct dns_update_request **preq) 333 333 { 334 struct dns_update_request *req ;335 struct dns_rrec *rec ;334 struct dns_update_request *req = NULL; 335 struct dns_rrec *rec = NULL; 336 336 DNS_ERROR err; 337 337 uint16 i; … … 370 370 struct dns_update_request **preq) 371 371 { 372 struct dns_update_request *req ;373 struct dns_rrec *rec ;372 struct dns_update_request *req = NULL; 373 struct dns_rrec *rec = NULL; 374 374 DNS_ERROR err; 375 375 size_t i; -
vendor/current/lib/async_req/async_sock.c
r740 r746 326 326 struct async_connect_state *state = 327 327 tevent_req_data(req, struct async_connect_state); 328 329 /* 330 * Stevens, Network Programming says that if there's a 331 * successful connect, the socket is only writable. Upon an 332 * error, it's both readable and writable. 333 */ 334 if ((flags & (TEVENT_FD_READ|TEVENT_FD_WRITE)) 335 == (TEVENT_FD_READ|TEVENT_FD_WRITE)) { 336 int ret; 337 338 ret = connect(state->fd, 339 (struct sockaddr *)(void *)&state->address, 340 state->address_len); 341 if (ret == 0) { 342 TALLOC_FREE(fde); 343 tevent_req_done(req); 344 return; 345 } 346 347 if (errno == EINPROGRESS) { 348 /* Try again later, leave the fde around */ 349 return; 350 } 328 int ret; 329 330 ret = connect(state->fd, (struct sockaddr *)(void *)&state->address, 331 state->address_len); 332 if (ret == 0) { 333 state->sys_errno = 0; 351 334 TALLOC_FREE(fde); 352 tevent_req_error(req, errno); 353 return; 354 } 355 356 state->sys_errno = 0; 357 tevent_req_done(req); 335 tevent_req_done(req); 336 return; 337 } 338 if (errno == EINPROGRESS) { 339 /* Try again later, leave the fde around */ 340 return; 341 } 342 state->sys_errno = errno; 343 TALLOC_FREE(fde); 344 tevent_req_error(req, errno); 345 return; 358 346 } 359 347 -
vendor/current/lib/crypto/hmacmd5.c
r740 r746 37 37 if (key_len > 64) 38 38 { 39 struct MD5Contexttctx;39 MD5_CTX tctx; 40 40 41 41 MD5Init(&tctx); … … 92 92 _PUBLIC_ void hmac_md5_final(uint8_t *digest, HMACMD5Context *ctx) 93 93 { 94 struct MD5Contextctx_o;94 MD5_CTX ctx_o; 95 95 96 96 MD5Final(digest, &ctx->ctx); -
vendor/current/lib/crypto/hmacmd5.h
r414 r746 26 26 typedef struct 27 27 { 28 struct MD5Contextctx;28 MD5_CTX ctx; 29 29 uint8_t k_ipad[65]; 30 30 uint8_t k_opad[65]; -
vendor/current/lib/crypto/md5.h
r414 r746 6 6 #endif 7 7 8 #ifdef HAVE_MD5_H 9 /* 10 * Try to avoid clashes with Solaris MD5 implementation. 11 * ...where almost all implementations follows: 12 * "Schneier's Cryptography Classics Library" 13 */ 14 #include <md5.h> 15 #else 16 8 17 struct MD5Context { 9 18 uint32_t buf[4]; … … 11 20 uint8_t in[64]; 12 21 }; 22 typedef struct MD5Context MD5_CTX; 13 23 14 24 void MD5Init(struct MD5Context *context); … … 17 27 void MD5Final(uint8_t digest[16], struct MD5Context *context); 18 28 29 #endif /* !HAVE_MD5_H */ 30 19 31 #endif /* !MD5_H */ -
vendor/current/lib/crypto/md5test.c
r740 r746 64 64 65 65 for (i=0; i < ARRAY_SIZE(testarray); i++) { 66 struct MD5Contextctx;66 MD5_CTX ctx; 67 67 uint8_t md5[16]; 68 68 int e; -
vendor/current/lib/popt/system.h
r414 r746 59 59 #elif defined(__GNUC__) && defined(__STRICT_ANSI__) 60 60 #define alloca __builtin_alloca 61 #elif defined(__GNUC__) && defined(HAVE_ALLOCA_H) 62 # include <alloca.h> 61 63 #endif 62 64 -
vendor/current/lib/replace/poll.c
r740 r746 31 31 #include "replace.h" 32 32 #include "system/select.h" 33 #ifdef HAVE_SYS_TIME_H 34 #include <sys/time.h> 35 #endif 36 #ifdef HAVE_SYS_IOCTL_H 37 #include <sys/ioctl.h> 38 #endif 33 39 34 40 … … 41 47 nfds_t i; 42 48 43 if ( fds == NULL) {49 if ((fds == NULL) && (nfds != 0)) { 44 50 errno = EFAULT; 45 51 return -1; -
vendor/current/lib/replace/replace.h
r740 r746 803 803 #endif 804 804 805 #if !defined(getpass) 806 #ifdef REPLACE_GETPASS 807 #if defined(REPLACE_GETPASS_BY_GETPASSPHRASE) 808 #define getpass(prompt) getpassphrase(prompt) 809 #else 810 #define getpass(prompt) rep_getpass(prompt) 811 char *rep_getpass(const char *prompt); 812 #endif 813 #endif 814 #endif 815 805 816 #endif /* _LIBREPLACE_REPLACE_H */ -
vendor/current/lib/replace/system/passwd.h
r740 r746 68 68 #endif 69 69 70 #if !defined(getpass) 70 71 #ifdef REPLACE_GETPASS 71 72 #if defined(REPLACE_GETPASS_BY_GETPASSPHRASE) … … 74 75 #define getpass(prompt) rep_getpass(prompt) 75 76 char *rep_getpass(const char *prompt); 77 #endif 76 78 #endif 77 79 #endif -
vendor/current/lib/talloc/talloc.3.xml
r740 r746 784 784 <para> 785 785 This program is free software; you can redistribute it and/or modify 786 it under the terms of the GNU General Public License as published by787 the Free Software Foundation; either version 3 of the License, or (at788 your option) any later version.786 it under the terms of the GNU Lesser General Public License as 787 published by the Free Software Foundation; either version 3 of the 788 License, or (at your option) any later version. 789 789 </para> 790 790 <para> -
vendor/current/lib/talloc/talloc.c
r740 r746 839 839 if (tc->prev) tc->prev->next = tc->next; 840 840 if (tc->next) tc->next->prev = tc->prev; 841 tc->prev = tc->next = NULL; 841 842 } 842 843 … … 926 927 if (tc->prev) tc->prev->next = tc->next; 927 928 if (tc->next) tc->next->prev = tc->prev; 929 tc->prev = tc->next = NULL; 928 930 } 929 931 … … 1252 1254 if (p) new_parent = TC_PTR_FROM_CHUNK(p); 1253 1255 } 1254 /* finding the parent here is potentially quite1255 expensive, but the alternative, which is to change1256 talloc to always have a valid tc->parent pointer,1257 makes realloc more expensive where there are a1258 large number of children.1259 1260 The reason we need the parent pointer here is that1261 if _talloc_free_internal() fails due to references1262 or a failing destructor we need to re-parent, but1263 the free call can invalidate the prev pointer.1264 */1265 if (new_parent == null_context && (tc->child->refs || tc->child->destructor)) {1266 old_parent = talloc_parent_chunk(ptr);1267 }1268 1256 if (unlikely(_talloc_free_internal(child, location) == -1)) { 1269 1257 if (new_parent == null_context) { 1270 struct talloc_chunk *p = old_parent;1258 struct talloc_chunk *p = talloc_parent_chunk(ptr); 1271 1259 if (p) new_parent = TC_PTR_FROM_CHUNK(p); 1272 1260 } … … 1283 1271 _PUBLIC_ void talloc_free_children(void *ptr) 1284 1272 { 1273 struct talloc_chunk *tc_name = NULL; 1285 1274 struct talloc_chunk *tc; 1286 1275 … … 1291 1280 tc = talloc_chunk_from_ptr(ptr); 1292 1281 1282 /* we do not want to free the context name if it is a child .. */ 1283 if (likely(tc->child)) { 1284 for (tc_name = tc->child; tc_name; tc_name = tc_name->next) { 1285 if (tc->name == TC_PTR_FROM_CHUNK(tc_name)) break; 1286 } 1287 if (tc_name) { 1288 _TLIST_REMOVE(tc->child, tc_name); 1289 if (tc->child) { 1290 tc->child->parent = tc; 1291 } 1292 } 1293 } 1294 1293 1295 _talloc_free_children_internal(tc, ptr, __location__); 1296 1297 /* .. so we put it back after all other children have been freed */ 1298 if (tc_name) { 1299 if (tc->child) { 1300 tc->child->parent = NULL; 1301 } 1302 tc_name->parent = tc; 1303 _TLIST_ADD(tc->child, tc_name); 1304 } 1294 1305 } 1295 1306 -
vendor/current/lib/talloc/talloc.h
r740 r746 174 174 * no modifications and return -1. 175 175 * 176 * If this pointer has an additional parent when talloc_free() is called 177 * then the memory is not actually released, but instead the most 178 * recently established parent is destroyed. See talloc_reference() for 179 * details on establishing additional parents. 180 * 181 * For more control on which parent is removed, see talloc_unlink() 182 * 183 * talloc_free() operates recursively on its children. 184 * 185 * From the 2.0 version of talloc, as a special case, talloc_free() is 186 * refused on pointers that have more than one parent, as talloc would 187 * have no way of knowing which parent should be removed. To free a 176 * From version 2.0 and onwards, as a special case, talloc_free() is 177 * refused on pointers that have more than one parent associated, as talloc 178 * would have no way of knowing which parent should be removed. This is 179 * different from older versions in the sense that always the reference to 180 * the most recently established parent has been destroyed. Hence to free a 188 181 * pointer that has more than one parent please use talloc_unlink(). 189 182 * … … 201 194 * talloc_set_log_stderr() for more information on talloc logging 202 195 * functions. 196 * 197 * talloc_free() operates recursively on its children. 203 198 * 204 199 * @param[in] ptr The chunk to be freed. … … 234 229 * talloc_free()s only the children, not the context itself. 235 230 * 236 * @param[in] ptr The chunk that you want to free the children of. 231 * A NULL argument is handled as no-op. 232 * 233 * @param[in] ptr The chunk that you want to free the children of 234 * (NULL is allowed too) 237 235 */ 238 236 void talloc_free_children(void *ptr); … … 403 401 * @param[in] new_ctx The new parent context. 404 402 * 405 * @param[in] p trPointer to the talloc chunk to move.403 * @param[in] pptr Pointer to the talloc chunk to move. 406 404 * 407 405 * @return The pointer of the talloc chunk it has been moved to, 408 406 * NULL on error. 409 407 */ 410 void *talloc_move(const void *new_ctx, const void *ptr);411 #else 412 #define talloc_move(ctx, p tr) (_TALLOC_TYPEOF(*(ptr)))_talloc_move((ctx),(void *)(ptr))408 void *talloc_move(const void *new_ctx, void **pptr); 409 #else 410 #define talloc_move(ctx, pptr) (_TALLOC_TYPEOF(*(pptr)))_talloc_move((ctx),(void *)(pptr)) 413 411 void *_talloc_move(const void *new_ctx, const void *pptr); 414 412 #endif … … 703 701 * @brief Assign a type to a talloc chunk. 704 702 * 705 * This macro allows you to force the name of a pointer to be a particular type.706 * This can be used in conjunction with talloc_get_type() to do type checking on707 * void* pointers.703 * This macro allows you to force the name of a pointer to be of a particular 704 * type. This can be used in conjunction with talloc_get_type() to do type 705 * checking on void* pointers. 708 706 * 709 707 * It is equivalent to this: … … 906 904 * cause this pointer to be freed if it runs out of parents. 907 905 * 908 * - you can talloc_free() the pointer itself . That will destroy the909 * most recently established parent to the pointer and leave the910 * pointer as a child of its current parent.906 * - you can talloc_free() the pointer itself if it has at maximum one 907 * parent. This behaviour has been changed since the release of version 908 * 2.0. Further informations in the description of "talloc_free". 911 909 * 912 910 * For more control on which parent to remove, see talloc_unlink() … … 943 941 * a direct parent of ptr. 944 942 * 945 * Usually you can just use talloc_free() instead of talloc_unlink(), but 946 * sometimes it is useful to have the additional control on which parent is 947 * removed. 943 * You can just use talloc_free() instead of talloc_unlink() if there 944 * is at maximum one parent. This behaviour has been changed since the 945 * release of version 2.0. Further informations in the description of 946 * "talloc_free". 948 947 * 949 948 * @param[in] context The talloc parent to remove. … … 993 992 * @brief Get the size of a talloc chunk. 994 993 * 995 * This function lets you know the amount of memory alloc ed so far by994 * This function lets you know the amount of memory allocated so far by 996 995 * this context. It does NOT account for subcontext memory. 997 996 * This can be used to calculate the size of an array. … … 1454 1453 * 1455 1454 * This function appends the given formatted string to the given string. Use 1456 * this vari ent when the string in the current talloc buffer may have been1455 * this variant when the string in the current talloc buffer may have been 1457 1456 * truncated in length. 1458 1457 * … … 1552 1551 * 1553 1552 * This provides a more detailed report than talloc_report(). It will 1554 * recursively print the en sire tree of memory referenced by the1553 * recursively print the entire tree of memory referenced by the 1555 1554 * pointer. References in the tree are shown by giving the name of the 1556 1555 * pointer that is referenced. -
vendor/current/lib/talloc/talloc_guide.txt
r740 r746 27 27 28 28 and the pointer X->name would be a "child" of the talloc context "X" 29 which is itself a child of mem_ctx. So if you do talloc_free(mem_ctx)29 which is itself a child of "mem_ctx". So if you do talloc_free(mem_ctx) 30 30 then it is all destroyed, whereas if you do talloc_free(X) then just X 31 31 and X->name are destroyed, and if you do talloc_free(X->name) then … … 65 65 the underlying "malloc" is), as long as each thread uses different 66 66 memory contexts. 67 If two threads use s the same context then they need to synchronize in67 If two threads use the same context then they need to synchronize in 68 68 order to be safe. In particular: 69 69 - when using talloc_enable_leak_report(), giving directly NULL as a … … 137 137 no modifications and returns -1. 138 138 139 If this pointer has an additional parent when talloc_free() is called 140 then the memory is not actually released, but instead the most 141 recently established parent is destroyed. See talloc_reference() for 142 details on establishing additional parents. 143 144 For more control on which parent is removed, see talloc_unlink() 145 146 talloc_free() operates recursively on its children. 147 148 From the 2.0 version of talloc, as a special case, talloc_free() is 149 refused on pointers that have more than one parent, as talloc would 150 have no way of knowing which parent should be removed. To free a 139 From version 2.0 and onwards, as a special case, talloc_free() is 140 refused on pointers that have more than one parent associated, as talloc 141 would have no way of knowing which parent should be removed. This is 142 different from older versions in the sense that always the reference to 143 the most recently established parent has been destroyed. Hence to free a 151 144 pointer that has more than one parent please use talloc_unlink(). 152 145 … … 163 156 functions. 164 157 165 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 166 int talloc_free_children(void *ptr); 158 talloc_free() operates recursively on its children. 159 160 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 161 void talloc_free_children(void *ptr); 167 162 168 163 The talloc_free_children() walks along the list of all children of a … … 170 165 itself. 171 166 167 A NULL argument is handled as no-op. 172 168 173 169 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- … … 191 187 cause this pointer to be freed if it runs out of parents. 192 188 193 - you can talloc_free() the pointer itself . That will destroy the194 most recently established parent to the pointer and leave the195 pointer as a child of its current parent.189 - you can talloc_free() the pointer itself if it has at maximum one 190 parent. This behaviour has been changed since the release of version 191 2.0. Further informations in the description of "talloc_free". 196 192 197 193 For more control on which parent to remove, see talloc_unlink() … … 209 205 is NULL, then the function will make no modifications and return -1. 210 206 211 Usually you can just use talloc_free() instead of talloc_unlink(), but 212 sometimes it is useful to have the additional control on which parent 213 is removed. 214 207 You can just use talloc_free() instead of talloc_unlink() if there 208 is at maximum one parent. This behaviour has been changed since the 209 release of version 2.0. Further informations in the description of 210 "talloc_free". 215 211 216 212 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- … … 484 480 485 481 This provides a more detailed report than talloc_report(). It will 486 recursively print the en sire tree of memory referenced by the482 recursively print the entire tree of memory referenced by the 487 483 pointer. References in the tree are shown by giving the name of the 488 484 pointer that is referenced. … … 643 639 The talloc_asprintf_append() function appends the given formatted 644 640 string to the given string. 645 Use this vari ent when the string in the current talloc buffer may641 Use this variant when the string in the current talloc buffer may 646 642 have been truncated in length. 647 643 … … 657 653 The talloc_asprintf_append() function appends the given formatted 658 654 string to the end of the currently allocated talloc buffer. 659 Use this vari ent when the string in the current talloc buffer has655 Use this variant when the string in the current talloc buffer has 660 656 not been changed. 661 657 … … 731 727 talloc_set_type(const void *ptr, type); 732 728 733 This macro allows you to force the name of a pointer to be a729 This macro allows you to force the name of a pointer to be of a 734 730 particular type. This can be used in conjunction with 735 731 talloc_get_type() to do type checking on void* pointers. … … 742 738 talloc_get_size(const void *ctx); 743 739 744 This function lets you know the amount of memory alloc ed so far by740 This function lets you know the amount of memory allocated so far by 745 741 this context. It does NOT account for subcontext memory. 746 742 This can be used to calculate the size of an array. … … 769 765 void talloc_set_log_stderr(void) 770 766 771 This sets the talloc log function to write log messages to stderr 767 This sets the talloc log function to write log messages to stderr. -
vendor/current/lib/talloc/testsuite.c
r740 r746 1318 1318 talloc_report_full(root, stdout); 1319 1319 talloc_free(root); 1320 CHECK_BLOCKS("null_context", NULL, 2); 1321 return true; 1322 } 1323 1324 static bool test_free_children(void) 1325 { 1326 void *root; 1327 const char *p1, *p2, *name, *name2; 1328 1329 talloc_enable_null_tracking(); 1330 root = talloc_new(NULL); 1331 p1 = talloc_strdup(root, "foo1"); 1332 p2 = talloc_strdup(p1, "foo2"); 1333 1334 talloc_set_name(p1, "%s", "testname"); 1335 talloc_free_children(p1); 1336 /* check its still a valid talloc ptr */ 1337 talloc_get_size(talloc_get_name(p1)); 1338 if (strcmp(talloc_get_name(p1), "testname") != 0) { 1339 return false; 1340 } 1341 1342 talloc_set_name(p1, "%s", "testname"); 1343 name = talloc_get_name(p1); 1344 talloc_free_children(p1); 1345 /* check its still a valid talloc ptr */ 1346 talloc_get_size(talloc_get_name(p1)); 1347 torture_assert("name", name == talloc_get_name(p1), "name ptr changed"); 1348 torture_assert("namecheck", strcmp(talloc_get_name(p1), "testname") == 0, 1349 "wrong name"); 1350 CHECK_BLOCKS("name1", p1, 2); 1351 1352 /* note that this does not free the old child name */ 1353 talloc_set_name_const(p1, "testname2"); 1354 name2 = talloc_get_name(p1); 1355 /* but this does */ 1356 talloc_free_children(p1); 1357 torture_assert("namecheck", strcmp(talloc_get_name(p1), "testname2") == 0, 1358 "wrong name"); 1359 CHECK_BLOCKS("name1", p1, 1); 1360 1361 talloc_report_full(root, stdout); 1362 talloc_free(root); 1320 1363 return true; 1321 1364 } … … 1380 1423 test_reset(); 1381 1424 ret &= test_rusty(); 1425 test_reset(); 1426 ret &= test_free_children(); 1382 1427 1383 1428 if (ret) { -
vendor/current/lib/tdb/common/io.c
r740 r746 54 54 } 55 55 56 /* Unmap, update size, remap */ 57 if (tdb_munmap(tdb) == -1) { 58 tdb->ecode = TDB_ERR_IO; 59 return -1; 60 } 61 tdb->map_size = st.st_size; 62 tdb_mmap(tdb); 63 56 64 if (st.st_size < (size_t)len) { 57 65 if (!probe) { … … 64 72 } 65 73 66 /* Unmap, update size, remap */67 if (tdb_munmap(tdb) == -1) {68 tdb->ecode = TDB_ERR_IO;69 return -1;70 }71 tdb->map_size = st.st_size;72 tdb_mmap(tdb);73 74 return 0; 74 75 } -
vendor/current/lib/tdb/common/open.c
r740 r746 314 314 (!tdb->read_only) && 315 315 (locked = (tdb_nest_lock(tdb, ACTIVE_LOCK, F_WRLCK, TDB_LOCK_NOWAIT|TDB_LOCK_PROBE) == 0))) { 316 open_flags |= O_CREAT; 317 if (ftruncate(tdb->fd, 0) == -1) { 316 int ret; 317 ret = tdb_brlock(tdb, F_WRLCK, FREELIST_TOP, 0, 318 TDB_LOCK_WAIT); 319 if (ret == -1) { 318 320 TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: " 319 "failed to truncate %s: %s\n", 320 name, strerror(errno))); 321 goto fail; /* errno set by ftruncate */ 321 "tdb_brlock failed for %s: %s\n", 322 name, strerror(errno))); 323 goto fail; 324 } 325 ret = tdb_new_database(tdb, hash_size); 326 if (ret == -1) { 327 TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: " 328 "tdb_new_database failed for %s: %s\n", 329 name, strerror(errno))); 330 tdb_unlockall(tdb); 331 goto fail; 332 } 333 ret = tdb_brunlock(tdb, F_WRLCK, FREELIST_TOP, 0); 334 if (ret == -1) { 335 TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: " 336 "tdb_unlockall failed for %s: %s\n", 337 name, strerror(errno))); 338 goto fail; 339 } 340 ret = lseek(tdb->fd, 0, SEEK_SET); 341 if (ret == -1) { 342 TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: " 343 "lseek failed for %s: %s\n", 344 name, strerror(errno))); 345 goto fail; 322 346 } 323 347 } -
vendor/current/lib/util/charset/iconv.c
r740 r746 97 97 return c; 98 98 } 99 c = c->next;100 99 } 101 100 -
vendor/current/lib/util/debug.c
r740 r746 203 203 TALLOC_FREE(format_bufr); 204 204 205 debug_num_classes = DBGC_MAX_FIXED;205 debug_num_classes = 0; 206 206 207 207 state.initialized = false; -
vendor/current/lib/util/debug.h
r740 r746 202 202 struct debug_settings { 203 203 size_t max_log_size; 204 boolsyslog;204 int syslog; 205 205 bool syslog_only; 206 206 bool timestamp_logs; -
vendor/current/lib/util/debug_s3.h
r740 r746 18 18 */ 19 19 20 #include "librpc/gen_ndr/server_id.h" 21 20 22 struct messaging_context; 21 23 struct server_id;
Note:
See TracChangeset
for help on using the changeset viewer.