Changeset 7c3fb9b in mainline for uspace/lib/bithenge/src/failure.c
- Timestamp:
- 2018-05-17T08:29:01Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/src/failure.c
rfac0ac7 r7c3fb9b 47 47 #include "common.h" 48 48 49 /* This file raises fake errors from system calls, to test that Bithenge 49 /* 50 * This file raises fake errors from system calls, to test that Bithenge 50 51 * handles the errors correctly. It has two primary modes of operation, 51 52 * depending on an environment variable: … … 60 61 * BITHENGE_FAILURE_INDEX set: the program runs normally until system call 61 62 * number BITHENGE_FAILURE_INDEX is made; a fake error is returned from this 62 * call. */ 63 * call. 64 */ 63 65 64 66 static int g_initialized = 0; … … 94 96 } 95 97 96 /* Record a hit for a backtrace address and return whether this is the first 97 * hit. */ 98 /* 99 * Record a hit for a backtrace address and return whether this is the first 100 * hit. 101 */ 98 102 static inline errno_t backtrace_item_hit(void *addr) 99 103 { … … 133 137 } 134 138 135 /* If all backtrace items have been seen already, there's no need to 136 * try raising an error. */ 139 /* 140 * If all backtrace items have been seen already, there's no need to 141 * try raising an error. 142 */ 137 143 void *trace[256]; 138 144 int size = backtrace(trace, 256); … … 162 168 return 0; 163 169 164 /* The child had an error! We couldn't easily debug it because it was 170 /* 171 * The child had an error! We couldn't easily debug it because it was 165 172 * in a separate process with redirected stdout and stderr. Do it again 166 * without redirecting or forking. */ 173 * without redirecting or forking. 174 */ 167 175 fprintf(stderr, "** Fake error raised here (BITHENGE_FAILURE_INDEX=%d)\n", 168 176 g_failure_index);
Note:
See TracChangeset
for help on using the changeset viewer.