Changeset 1433ecda in mainline for uspace/lib/pcut/src/os/unix.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/os/unix.c
r47b2d7e3 r1433ecda 64 64 * @param test Test that is about to be run. 65 65 */ 66 static void before_test_start(pcut_item_t *test) { 66 static void before_test_start(pcut_item_t *test) 67 { 67 68 pcut_report_test_start(test); 68 69 … … 78 79 * @param sig Signal number. 79 80 */ 80 static void kill_child_on_alarm(int sig) { 81 static void kill_child_on_alarm(int sig) 82 { 81 83 PCUT_UNUSED(sig); 82 84 kill(child_pid, SIGKILL); … … 94 96 * @return Number of actually read bytes. 95 97 */ 96 static size_t read_all(int fd, char *buffer, size_t buffer_size) { 98 static size_t read_all(int fd, char *buffer, size_t buffer_size) 99 { 97 100 ssize_t actually_read; 98 101 char *buffer_start = buffer; … … 121 124 * @return Test outcome code. 122 125 */ 123 static int convert_wait_status_to_outcome(int status) { 126 static int convert_wait_status_to_outcome(int status) 127 { 124 128 if (WIFEXITED(status)) { 125 129 if (WEXITSTATUS(status) != 0) { … … 142 146 * @param test Test to be run. 143 147 */ 144 int pcut_run_test_forking(const char *self_path, pcut_item_t *test) { 148 int pcut_run_test_forking(const char *self_path, pcut_item_t *test) 149 { 145 150 int link_stdout[2], link_stderr[2]; 146 151 int rc, status, outcome; … … 155 160 if (rc == -1) { 156 161 snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1, 157 162 "pipe() failed: %s.", strerror(rc)); 158 163 pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL); 159 164 return PCUT_OUTCOME_INTERNAL_ERROR; … … 162 167 if (rc == -1) { 163 168 snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1, 164 169 "pipe() failed: %s.", strerror(rc)); 165 170 pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL); 166 171 return PCUT_OUTCOME_INTERNAL_ERROR; … … 170 175 if (child_pid == (pid_t)-1) { 171 176 snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1, 172 177 "fork() failed: %s.", strerror(rc)); 173 178 outcome = PCUT_OUTCOME_INTERNAL_ERROR; 174 179 goto leave_close_pipes; … … 215 220 } 216 221 217 void pcut_hook_before_test(pcut_item_t *test) { 222 void pcut_hook_before_test(pcut_item_t *test) 223 { 218 224 PCUT_UNUSED(test); 219 225
Note:
See TracChangeset
for help on using the changeset viewer.