Changeset 340c3e7
- Timestamp:
- Oct 3, 2009, 10:12:06 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 8830f79f
- Parents:
- 40bda84
- git-author:
- Nelson Elhage <nelhage@mit.edu> (09/12/09 19:47:59)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (10/03/09 10:12:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rb0a6ea0 r340c3e7 3397 3397 void owl_function_error(const char *fmt, ...) 3398 3398 { 3399 static int in_error = 0; 3399 3400 va_list ap; 3400 3401 char *buff; 3401 3402 const char *nl; 3402 3403 3404 if (++in_error > 2) { 3405 /* More than two nested errors, bail immediately. */ 3406 in_error--; 3407 return; 3408 } 3409 3403 3410 va_start(ap, fmt); 3404 3405 3411 buff = g_strdup_vprintf(fmt, ap); 3412 va_end(ap); 3413 3406 3414 owl_function_debugmsg("ERROR: %s", buff); 3415 owl_function_log_err(buff); 3416 3407 3417 nl = strchr(buff, '\n'); 3408 if(nl && *(nl + 1)) { 3418 3419 /* 3420 Showing admin messages triggers a lot of code. If we have a 3421 recursive error call, that's the most likely candidate, so 3422 suppress the call in that case, to try to avoid infinite looping. 3423 */ 3424 3425 if(nl && *(nl + 1) && in_error == 1) { 3409 3426 /* Multiline error */ 3410 3427 owl_function_adminmsg("ERROR", buff); … … 3412 3429 owl_function_makemsg("[Error] %s", buff); 3413 3430 } 3414 owl_function_log_err(buff); 3415 va_end(ap); 3431 3416 3432 owl_free(buff); 3433 3434 in_error--; 3417 3435 } 3418 3436
Note: See TracChangeset
for help on using the changeset viewer.