| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/tee.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | static | - | ||||||||||||||||||||||||||||||
| 4 | _Bool | - | ||||||||||||||||||||||||||||||
| 5 | tee_files (int nfiles, char **files); | - | ||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||
| 8 | static | - | ||||||||||||||||||||||||||||||
| 9 | _Bool | - | ||||||||||||||||||||||||||||||
| 10 | append; | - | ||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||
| 13 | static | - | ||||||||||||||||||||||||||||||
| 14 | _Bool | - | ||||||||||||||||||||||||||||||
| 15 | ignore_interrupts; | - | ||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||
| 17 | enum output_error | - | ||||||||||||||||||||||||||||||
| 18 | { | - | ||||||||||||||||||||||||||||||
| 19 | output_error_sigpipe, | - | ||||||||||||||||||||||||||||||
| 20 | output_error_warn, | - | ||||||||||||||||||||||||||||||
| 21 | output_error_warn_nopipe, | - | ||||||||||||||||||||||||||||||
| 22 | output_error_exit, | - | ||||||||||||||||||||||||||||||
| 23 | output_error_exit_nopipe | - | ||||||||||||||||||||||||||||||
| 24 | }; | - | ||||||||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||||||||
| 26 | static enum output_error output_error; | - | ||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||
| 28 | static struct option const long_options[] = | - | ||||||||||||||||||||||||||||||
| 29 | { | - | ||||||||||||||||||||||||||||||
| 30 | {"append", | - | ||||||||||||||||||||||||||||||
| 31 | 0 | - | ||||||||||||||||||||||||||||||
| 32 | , | - | ||||||||||||||||||||||||||||||
| 33 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 34 | , 'a'}, | - | ||||||||||||||||||||||||||||||
| 35 | {"ignore-interrupts", | - | ||||||||||||||||||||||||||||||
| 36 | 0 | - | ||||||||||||||||||||||||||||||
| 37 | , | - | ||||||||||||||||||||||||||||||
| 38 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 39 | , 'i'}, | - | ||||||||||||||||||||||||||||||
| 40 | {"output-error", | - | ||||||||||||||||||||||||||||||
| 41 | 2 | - | ||||||||||||||||||||||||||||||
| 42 | , | - | ||||||||||||||||||||||||||||||
| 43 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 44 | , 'p'}, | - | ||||||||||||||||||||||||||||||
| 45 | {"help", | - | ||||||||||||||||||||||||||||||
| 46 | 0 | - | ||||||||||||||||||||||||||||||
| 47 | , | - | ||||||||||||||||||||||||||||||
| 48 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 49 | , GETOPT_HELP_CHAR}, | - | ||||||||||||||||||||||||||||||
| 50 | {"version", | - | ||||||||||||||||||||||||||||||
| 51 | 0 | - | ||||||||||||||||||||||||||||||
| 52 | , | - | ||||||||||||||||||||||||||||||
| 53 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 54 | , GETOPT_VERSION_CHAR}, | - | ||||||||||||||||||||||||||||||
| 55 | { | - | ||||||||||||||||||||||||||||||
| 56 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 57 | , 0, | - | ||||||||||||||||||||||||||||||
| 58 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 59 | , 0} | - | ||||||||||||||||||||||||||||||
| 60 | }; | - | ||||||||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||||||||
| 62 | static char const *const output_error_args[] = | - | ||||||||||||||||||||||||||||||
| 63 | { | - | ||||||||||||||||||||||||||||||
| 64 | "warn", "warn-nopipe", "exit", "exit-nopipe", | - | ||||||||||||||||||||||||||||||
| 65 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||||||||
| 67 | }; | - | ||||||||||||||||||||||||||||||
| 68 | static enum output_error const output_error_types[] = | - | ||||||||||||||||||||||||||||||
| 69 | { | - | ||||||||||||||||||||||||||||||
| 70 | output_error_warn, output_error_warn_nopipe, | - | ||||||||||||||||||||||||||||||
| 71 | output_error_exit, output_error_exit_nopipe | - | ||||||||||||||||||||||||||||||
| 72 | }; | - | ||||||||||||||||||||||||||||||
| 73 | _Static_assert ((sizeof (output_error_args) / sizeof *(output_error_args)) == (sizeof (output_error_types) / sizeof *(output_error_types)) + 1, "verify (" "ARRAY_CARDINALITY (output_error_args) == ARRAY_CARDINALITY (output_error_types) + 1" ")"); | - | ||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||
| 75 | void | - | ||||||||||||||||||||||||||||||
| 76 | usage (int status) | - | ||||||||||||||||||||||||||||||
| 77 | { | - | ||||||||||||||||||||||||||||||
| 78 | if (status !=
| 3-9 | ||||||||||||||||||||||||||||||
| 79 | 0
| 3-9 | ||||||||||||||||||||||||||||||
| 80 | ) | - | ||||||||||||||||||||||||||||||
| 81 | do { fprintf ( | - | ||||||||||||||||||||||||||||||
| 82 | stderr | - | ||||||||||||||||||||||||||||||
| 83 | , | - | ||||||||||||||||||||||||||||||
| 84 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 85 | "Try '%s --help' for more information.\n" | - | ||||||||||||||||||||||||||||||
| 86 | , 5) | - | ||||||||||||||||||||||||||||||
| 87 | , program_name); } executed 3 times by 1 test: while (0);end of blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||
| 88 | else | - | ||||||||||||||||||||||||||||||
| 89 | { | - | ||||||||||||||||||||||||||||||
| 90 | printf ( | - | ||||||||||||||||||||||||||||||
| 91 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 92 | "Usage: %s [OPTION]... [FILE]...\n" | - | ||||||||||||||||||||||||||||||
| 93 | , 5) | - | ||||||||||||||||||||||||||||||
| 94 | , program_name); | - | ||||||||||||||||||||||||||||||
| 95 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||
| 96 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 97 | "Copy standard input to each FILE, and also to standard output.\n\n -a, --append append to the given FILEs, do not overwrite\n -i, --ignore-interrupts ignore interrupt signals\n" | - | ||||||||||||||||||||||||||||||
| 98 | , 5) | - | ||||||||||||||||||||||||||||||
| 99 | , | - | ||||||||||||||||||||||||||||||
| 100 | stdout | - | ||||||||||||||||||||||||||||||
| 101 | ) | - | ||||||||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||
| 106 | ; | - | ||||||||||||||||||||||||||||||
| 107 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||
| 108 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 109 | " -p diagnose errors writing to non pipes\n --output-error[=MODE] set behavior on write error. See MODE below\n" | - | ||||||||||||||||||||||||||||||
| 110 | , 5) | - | ||||||||||||||||||||||||||||||
| 111 | , | - | ||||||||||||||||||||||||||||||
| 112 | stdout | - | ||||||||||||||||||||||||||||||
| 113 | ) | - | ||||||||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||||||||
| 116 | ; | - | ||||||||||||||||||||||||||||||
| 117 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||
| 118 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 119 | " --help display this help and exit\n" | - | ||||||||||||||||||||||||||||||
| 120 | , 5) | - | ||||||||||||||||||||||||||||||
| 121 | , | - | ||||||||||||||||||||||||||||||
| 122 | stdout | - | ||||||||||||||||||||||||||||||
| 123 | ); | - | ||||||||||||||||||||||||||||||
| 124 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||
| 125 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 126 | " --version output version information and exit\n" | - | ||||||||||||||||||||||||||||||
| 127 | , 5) | - | ||||||||||||||||||||||||||||||
| 128 | , | - | ||||||||||||||||||||||||||||||
| 129 | stdout | - | ||||||||||||||||||||||||||||||
| 130 | ); | - | ||||||||||||||||||||||||||||||
| 131 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||
| 132 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 133 | "\nMODE determines behavior with write errors on the outputs:\n 'warn' diagnose errors writing to any output\n 'warn-nopipe' diagnose errors writing to any output not a pipe\n 'exit' exit on error writing to any output\n 'exit-nopipe' exit on error writing to any output not a pipe\nThe default MODE for the -p option is 'warn-nopipe'.\nThe default operation when --output-error is not specified, is to\nexit immediately on error writing to a pipe, and diagnose errors\nwriting to non pipe outputs.\n" | - | ||||||||||||||||||||||||||||||
| 134 | , 5) | - | ||||||||||||||||||||||||||||||
| 135 | , | - | ||||||||||||||||||||||||||||||
| 136 | stdout | - | ||||||||||||||||||||||||||||||
| 137 | ) | - | ||||||||||||||||||||||||||||||
| 138 | ; | - | ||||||||||||||||||||||||||||||
| 139 | emit_ancillary_info ("tee"); | - | ||||||||||||||||||||||||||||||
| 140 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||||||||
| 141 | exit (status); executed 12 times by 1 test: exit (status);Executed by:
| 12 | ||||||||||||||||||||||||||||||
| 142 | } | - | ||||||||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||||||||
| 144 | int | - | ||||||||||||||||||||||||||||||
| 145 | main (int argc, char **argv) | - | ||||||||||||||||||||||||||||||
| 146 | { | - | ||||||||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||||||||
| 148 | _Bool | - | ||||||||||||||||||||||||||||||
| 149 | ok; | - | ||||||||||||||||||||||||||||||
| 150 | int optc; | - | ||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||
| 152 | ; | - | ||||||||||||||||||||||||||||||
| 153 | set_program_name (argv[0]); | - | ||||||||||||||||||||||||||||||
| 154 | setlocale ( | - | ||||||||||||||||||||||||||||||
| 155 | 6 | - | ||||||||||||||||||||||||||||||
| 156 | , ""); | - | ||||||||||||||||||||||||||||||
| 157 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||||||||||||||||||||||||||
| 158 | textdomain ("coreutils"); | - | ||||||||||||||||||||||||||||||
| 159 | - | |||||||||||||||||||||||||||||||
| 160 | atexit (close_stdout); | - | ||||||||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||||||||
| 162 | append = | - | ||||||||||||||||||||||||||||||
| 163 | 0 | - | ||||||||||||||||||||||||||||||
| 164 | ; | - | ||||||||||||||||||||||||||||||
| 165 | ignore_interrupts = | - | ||||||||||||||||||||||||||||||
| 166 | 0 | - | ||||||||||||||||||||||||||||||
| 167 | ; | - | ||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||
| 169 | while ((
| 52-61 | ||||||||||||||||||||||||||||||
| 170 | ((void *)0)
| 52-61 | ||||||||||||||||||||||||||||||
| 171 | )) != -1
| 52-61 | ||||||||||||||||||||||||||||||
| 172 | { | - | ||||||||||||||||||||||||||||||
| 173 | switch (optc) | - | ||||||||||||||||||||||||||||||
| 174 | { | - | ||||||||||||||||||||||||||||||
| 175 | case executed 36 times by 1 test: 'a':case 'a':Executed by:
executed 36 times by 1 test: case 'a':Executed by:
| 36 | ||||||||||||||||||||||||||||||
| 176 | append = | - | ||||||||||||||||||||||||||||||
| 177 | 1 | - | ||||||||||||||||||||||||||||||
| 178 | ; | - | ||||||||||||||||||||||||||||||
| 179 | break; executed 36 times by 1 test: break;Executed by:
| 36 | ||||||||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||||||||
| 181 | case executed 2 times by 1 test: 'i':case 'i':Executed by:
executed 2 times by 1 test: case 'i':Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 182 | ignore_interrupts = | - | ||||||||||||||||||||||||||||||
| 183 | 1 | - | ||||||||||||||||||||||||||||||
| 184 | ; | - | ||||||||||||||||||||||||||||||
| 185 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||||||||
| 187 | case executed 7 times by 1 test: 'p':case 'p':Executed by:
executed 7 times by 1 test: case 'p':Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 188 | if (optarg
| 3-4 | ||||||||||||||||||||||||||||||
| 189 | output_error = ((output_error_types) [__xargmatch_internal ("--output-error", optarg, output_error_args, (char const *) (output_error_types), sizeof *(output_error_types), argmatch_die)]) executed 4 times by 1 test: output_error = ((output_error_types) [__xargmatch_internal ("--output-error", optarg, output_error_args, (char const *) (output_error_types), sizeof *(output_error_types), argmatch_die)]) ;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 190 | ; executed 4 times by 1 test: output_error = ((output_error_types) [__xargmatch_internal ("--output-error", optarg, output_error_args, (char const *) (output_error_types), sizeof *(output_error_types), argmatch_die)]) ;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 191 | else | - | ||||||||||||||||||||||||||||||
| 192 | output_error = output_error_warn_nopipe; executed 3 times by 1 test: output_error = output_error_warn_nopipe;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 193 | break; executed 7 times by 1 test: break;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||
| 195 | case executed 9 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 9 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 9 | ||||||||||||||||||||||||||||||
| 196 | 0 | - | ||||||||||||||||||||||||||||||
| 197 | ); break; never executed: ;break; | 0 | ||||||||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||||||||
| 199 | case executed 4 times by 1 test: GETOPT_VERSION_CHAR:case GETOPT_VERSION_CHAR:Executed by:
executed 4 times by 1 test: version_etc (case GETOPT_VERSION_CHAR:Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 200 | stdout | - | ||||||||||||||||||||||||||||||
| 201 | , "tee", "GNU coreutils", Version, ("Mike Parker"), ("Richard M. Stallman"), ("David MacKenzie"), (char *) | - | ||||||||||||||||||||||||||||||
| 202 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 203 | ); exit ( executed 4 times by 1 test: exit ( 0 );Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 204 | 0 executed 4 times by 1 test: exit ( 0 );Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 205 | ); executed 4 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-4 | ||||||||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||||||||
| 207 | default executed 3 times by 1 test: :default:Executed by:
executed 3 times by 1 test: default:Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 208 | usage ( | - | ||||||||||||||||||||||||||||||
| 209 | 1 | - | ||||||||||||||||||||||||||||||
| 210 | ); | - | ||||||||||||||||||||||||||||||
| 211 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 212 | } | - | ||||||||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||||||||
| 214 | if (ignore_interrupts
| 0-52 | ||||||||||||||||||||||||||||||
| 215 | signal ( never executed: signal ( 2 , ((__sighandler_t) 1) ); | 0 | ||||||||||||||||||||||||||||||
| 216 | 2 never executed: signal ( 2 , ((__sighandler_t) 1) ); | 0 | ||||||||||||||||||||||||||||||
| 217 | , never executed: signal ( 2 , ((__sighandler_t) 1) ); | 0 | ||||||||||||||||||||||||||||||
| 218 | ((__sighandler_t) 1) never executed: signal ( 2 , ((__sighandler_t) 1) ); | 0 | ||||||||||||||||||||||||||||||
| 219 | ); never executed: signal ( 2 , ((__sighandler_t) 1) ); | 0 | ||||||||||||||||||||||||||||||
| 220 | - | |||||||||||||||||||||||||||||||
| 221 | if (output_error != output_error_sigpipe
| 5-47 | ||||||||||||||||||||||||||||||
| 222 | signal ( executed 5 times by 1 test: signal ( 13 , ((__sighandler_t) 1) );Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 223 | 13 executed 5 times by 1 test: signal ( 13 , ((__sighandler_t) 1) );Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 224 | , executed 5 times by 1 test: signal ( 13 , ((__sighandler_t) 1) );Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 225 | ((__sighandler_t) 1) executed 5 times by 1 test: signal ( 13 , ((__sighandler_t) 1) );Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 226 | ); executed 5 times by 1 test: signal ( 13 , ((__sighandler_t) 1) );Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||||||||
| 228 | - | |||||||||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||
| 231 | ok = tee_files (argc - optind, &argv[optind]); | - | ||||||||||||||||||||||||||||||
| 232 | if (close (
| 0-50 | ||||||||||||||||||||||||||||||
| 233 | 0
| 0-50 | ||||||||||||||||||||||||||||||
| 234 | ) != 0
| 0-50 | ||||||||||||||||||||||||||||||
| 235 | (( never executed: !!sizeof (struct { _Static_assert (((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 236 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 237 | , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 238 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 239 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 240 | (*__errno_location ()) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 241 | , "%s", never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 242 | dcgettext (((void *)0), never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 243 | "standard input" never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 244 | , 5) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 245 | ), (( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 246 | 0 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 247 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 248 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 249 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 250 | (*__errno_location ()) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 251 | , "%s", never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 252 | dcgettext (((void *)0), never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 253 | "standard input" never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 254 | , 5) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 255 | ), (( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 256 | 0 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 257 | ) ? (void) 0 : __builtin_unreachable ())))); never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"standard input\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "standard input" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||
| 259 | return executed 50 times by 1 test: ok ? return ok ? 0 : 1 ;Executed by:
executed 50 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 260 | 0 executed 50 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 261 | : executed 50 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 262 | 1 executed 50 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 263 | ; executed 50 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 264 | } | - | ||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||||||||
| 270 | static | - | ||||||||||||||||||||||||||||||
| 271 | _Bool | - | ||||||||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||||||||
| 273 | tee_files (int nfiles, char **files) | - | ||||||||||||||||||||||||||||||
| 274 | { | - | ||||||||||||||||||||||||||||||
| 275 | size_t n_outputs = 0; | - | ||||||||||||||||||||||||||||||
| 276 | FILE **descriptors; | - | ||||||||||||||||||||||||||||||
| 277 | char buffer[ | - | ||||||||||||||||||||||||||||||
| 278 | 8192 | - | ||||||||||||||||||||||||||||||
| 279 | ]; | - | ||||||||||||||||||||||||||||||
| 280 | ssize_t bytes_read = 0; | - | ||||||||||||||||||||||||||||||
| 281 | int i; | - | ||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||
| 283 | _Bool | - | ||||||||||||||||||||||||||||||
| 284 | ok = | - | ||||||||||||||||||||||||||||||
| 285 | 1 | - | ||||||||||||||||||||||||||||||
| 286 | ; | - | ||||||||||||||||||||||||||||||
| 287 | char const *mode_string = | - | ||||||||||||||||||||||||||||||
| 288 | ( | - | ||||||||||||||||||||||||||||||
| 289 | 0 | - | ||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||
| 291 | ? ( dead code: append ? "ab" : "wb")(append ? "ab" : "wb")dead code: (append ? "ab" : "wb") | - | ||||||||||||||||||||||||||||||
| 292 | : (append
| 18-34 | ||||||||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||||||||
| 294 | xset_binary_mode ( | - | ||||||||||||||||||||||||||||||
| 295 | 0 | - | ||||||||||||||||||||||||||||||
| 296 | , | - | ||||||||||||||||||||||||||||||
| 297 | 0 | - | ||||||||||||||||||||||||||||||
| 298 | ); | - | ||||||||||||||||||||||||||||||
| 299 | xset_binary_mode ( | - | ||||||||||||||||||||||||||||||
| 300 | 1 | - | ||||||||||||||||||||||||||||||
| 301 | , | - | ||||||||||||||||||||||||||||||
| 302 | 0 | - | ||||||||||||||||||||||||||||||
| 303 | ); | - | ||||||||||||||||||||||||||||||
| 304 | fadvise ( | - | ||||||||||||||||||||||||||||||
| 305 | stdin | - | ||||||||||||||||||||||||||||||
| 306 | , FADVISE_SEQUENTIAL); | - | ||||||||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||||||||
| 311 | descriptors = xnmalloc (nfiles + 1, sizeof *descriptors); | - | ||||||||||||||||||||||||||||||
| 312 | files--; | - | ||||||||||||||||||||||||||||||
| 313 | descriptors[0] = | - | ||||||||||||||||||||||||||||||
| 314 | stdout | - | ||||||||||||||||||||||||||||||
| 315 | ; | - | ||||||||||||||||||||||||||||||
| 316 | files[0] = bad_cast ( | - | ||||||||||||||||||||||||||||||
| 317 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 318 | "standard output" | - | ||||||||||||||||||||||||||||||
| 319 | , 5) | - | ||||||||||||||||||||||||||||||
| 320 | ); | - | ||||||||||||||||||||||||||||||
| 321 | setvbuf ( | - | ||||||||||||||||||||||||||||||
| 322 | stdout | - | ||||||||||||||||||||||||||||||
| 323 | , | - | ||||||||||||||||||||||||||||||
| 324 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 325 | , | - | ||||||||||||||||||||||||||||||
| 326 | 2 | - | ||||||||||||||||||||||||||||||
| 327 | , 0); | - | ||||||||||||||||||||||||||||||
| 328 | n_outputs++; | - | ||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||
| 330 | for (i = 1; i <= nfiles
| 51-72 | ||||||||||||||||||||||||||||||
| 331 | { | - | ||||||||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||||||||
| 333 | descriptors[i] = fopen_safer (files[i], mode_string); | - | ||||||||||||||||||||||||||||||
| 334 | if (descriptors[i] ==
| 2-70 | ||||||||||||||||||||||||||||||
| 335 | ((void *)0)
| 2-70 | ||||||||||||||||||||||||||||||
| 336 | ) | - | ||||||||||||||||||||||||||||||
| 337 | { | - | ||||||||||||||||||||||||||||||
| 338 | error (output_error == output_error_exit | - | ||||||||||||||||||||||||||||||
| 339 | || output_error == output_error_exit_nopipe, | - | ||||||||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||||||||
| 341 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 342 | , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, files[i])); | - | ||||||||||||||||||||||||||||||
| 343 | ok = | - | ||||||||||||||||||||||||||||||
| 344 | 0 | - | ||||||||||||||||||||||||||||||
| 345 | ; | - | ||||||||||||||||||||||||||||||
| 346 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 347 | else | - | ||||||||||||||||||||||||||||||
| 348 | { | - | ||||||||||||||||||||||||||||||
| 349 | setvbuf (descriptors[i], | - | ||||||||||||||||||||||||||||||
| 350 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 351 | , | - | ||||||||||||||||||||||||||||||
| 352 | 2 | - | ||||||||||||||||||||||||||||||
| 353 | , 0); | - | ||||||||||||||||||||||||||||||
| 354 | n_outputs++; | - | ||||||||||||||||||||||||||||||
| 355 | } executed 70 times by 1 test: end of blockExecuted by:
| 70 | ||||||||||||||||||||||||||||||
| 356 | } | - | ||||||||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||||||||
| 358 | while (n_outputs
| 5-143 | ||||||||||||||||||||||||||||||
| 359 | { | - | ||||||||||||||||||||||||||||||
| 360 | bytes_read = read (0, buffer, sizeof buffer); | - | ||||||||||||||||||||||||||||||
| 361 | if (bytes_read < 0
| 0-143 | ||||||||||||||||||||||||||||||
| 362 | (*
| 0 | ||||||||||||||||||||||||||||||
| 363 | ==
| 0 | ||||||||||||||||||||||||||||||
| 364 | 4
| 0 | ||||||||||||||||||||||||||||||
| 365 | ) | - | ||||||||||||||||||||||||||||||
| 366 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||
| 367 | if (bytes_read <= 0
| 45-98 | ||||||||||||||||||||||||||||||
| 368 | break; executed 45 times by 1 test: break;Executed by:
| 45 | ||||||||||||||||||||||||||||||
| 369 | - | |||||||||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||||||||
| 372 | for (i = 0; i <= nfiles
| 97-201 | ||||||||||||||||||||||||||||||
| 373 | if (descriptors[i]
| 19-182 | ||||||||||||||||||||||||||||||
| 374 | && | - | ||||||||||||||||||||||||||||||
| 375 | (
| 0-182 | ||||||||||||||||||||||||||||||
| 376 | bytes_read
| 0-182 | ||||||||||||||||||||||||||||||
| 377 | )
| 0-182 | ||||||||||||||||||||||||||||||
| 378 | 1
| 0-173 | ||||||||||||||||||||||||||||||
| 379 | )
| 0-173 | ||||||||||||||||||||||||||||||
| 380 | bytes_read
| 0-173 | ||||||||||||||||||||||||||||||
| 381 | ) * (size_t) (
| 0-173 | ||||||||||||||||||||||||||||||
| 382 | 1
| 0-173 | ||||||||||||||||||||||||||||||
| 383 | ) <= 8
| 0-173 | ||||||||||||||||||||||||||||||
| 384 | bytes_read
| 0-173 | ||||||||||||||||||||||||||||||
| 385 | ) != 0
| 0-173 | ||||||||||||||||||||||||||||||
| 386 | buffer
| 9-173 | ||||||||||||||||||||||||||||||
| 387 | ); FILE *__stream = (
| 9-173 | ||||||||||||||||||||||||||||||
| 388 | descriptors[i]
| 9-173 | ||||||||||||||||||||||||||||||
| 389 | ); size_t __cnt; for (__cnt = (size_t) (
| 9-173 | ||||||||||||||||||||||||||||||
| 390 | bytes_read
| 9-173 | ||||||||||||||||||||||||||||||
| 391 | ) * (size_t) (
| 9-173 | ||||||||||||||||||||||||||||||
| 392 | 1
| 9-173 | ||||||||||||||||||||||||||||||
| 393 | ); __cnt > 0
never executed: ((size_t) (break;
| 0-173 | ||||||||||||||||||||||||||||||
| 394 | bytes_read
| 9-173 | ||||||||||||||||||||||||||||||
| 395 | ) * (size_t) (
| 9-173 | ||||||||||||||||||||||||||||||
| 396 | 1
| 9-173 | ||||||||||||||||||||||||||||||
| 397 | ) - __cnt) / (size_t) (
| 9-173 | ||||||||||||||||||||||||||||||
| 398 | bytes_read
| 9-173 | ||||||||||||||||||||||||||||||
| 399 | ); }) : (((__builtin_constant_p (
| 0-182 | ||||||||||||||||||||||||||||||
| 400 | bytes_read
| 0-182 | ||||||||||||||||||||||||||||||
| 401 | )
| 0-182 | ||||||||||||||||||||||||||||||
| 402 | bytes_read
| 0-173 | ||||||||||||||||||||||||||||||
| 403 | ) == 0
| 0-182 | ||||||||||||||||||||||||||||||
| 404 | 1
| 0-182 | ||||||||||||||||||||||||||||||
| 405 | )
| 0-182 | ||||||||||||||||||||||||||||||
| 406 | 1
| 0-182 | ||||||||||||||||||||||||||||||
| 407 | ) == 0
| 0-182 | ||||||||||||||||||||||||||||||
| 408 | buffer
| 9-173 | ||||||||||||||||||||||||||||||
| 409 | ), (void) (
| 9-173 | ||||||||||||||||||||||||||||||
| 410 | descriptors[i]
| 9-173 | ||||||||||||||||||||||||||||||
| 411 | ), (void) (
| 9-173 | ||||||||||||||||||||||||||||||
| 412 | bytes_read
| 9-173 | ||||||||||||||||||||||||||||||
| 413 | ), (void) (
| 9-173 | ||||||||||||||||||||||||||||||
| 414 | 1
| 9-173 | ||||||||||||||||||||||||||||||
| 415 | ), (size_t) 0) : fwrite_unlocked (
| 9-173 | ||||||||||||||||||||||||||||||
| 416 | buffer
| 9-173 | ||||||||||||||||||||||||||||||
| 417 | ,
| 9-173 | ||||||||||||||||||||||||||||||
| 418 | bytes_read
| 9-173 | ||||||||||||||||||||||||||||||
| 419 | ,
| 9-173 | ||||||||||||||||||||||||||||||
| 420 | 1
| 9-173 | ||||||||||||||||||||||||||||||
| 421 | ,
| 9-173 | ||||||||||||||||||||||||||||||
| 422 | descriptors[i]
| 9-173 | ||||||||||||||||||||||||||||||
| 423 | ))))
| 9-173 | ||||||||||||||||||||||||||||||
| 424 | != 1
| 9-173 | ||||||||||||||||||||||||||||||
| 425 | { | - | ||||||||||||||||||||||||||||||
| 426 | int w_errno = | - | ||||||||||||||||||||||||||||||
| 427 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 428 | ; | - | ||||||||||||||||||||||||||||||
| 429 | - | |||||||||||||||||||||||||||||||
| 430 | _Bool | - | ||||||||||||||||||||||||||||||
| 431 | fail = | - | ||||||||||||||||||||||||||||||
| 432 | (*
| 4-5 | ||||||||||||||||||||||||||||||
| 433 | !=
| 4-5 | ||||||||||||||||||||||||||||||
| 434 | 32
| 4-5 | ||||||||||||||||||||||||||||||
| 435 | || (output_error == output_error_exit
| 1-4 | ||||||||||||||||||||||||||||||
| 436 | || output_error == output_error_warn
| 1-3 | ||||||||||||||||||||||||||||||
| 437 | if (descriptors[i] ==
| 2-7 | ||||||||||||||||||||||||||||||
| 438 | stdout
| 2-7 | ||||||||||||||||||||||||||||||
| 439 | ) | - | ||||||||||||||||||||||||||||||
| 440 | clearerr_unlocked ( executed 7 times by 1 test: clearerr_unlocked ( stdout );Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 441 | stdout executed 7 times by 1 test: clearerr_unlocked ( stdout );Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 442 | ); executed 7 times by 1 test: clearerr_unlocked ( stdout );Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 443 | if (fail
| 3-6 | ||||||||||||||||||||||||||||||
| 444 | { | - | ||||||||||||||||||||||||||||||
| 445 | error (output_error == output_error_exit | - | ||||||||||||||||||||||||||||||
| 446 | || output_error == output_error_exit_nopipe, | - | ||||||||||||||||||||||||||||||
| 447 | w_errno, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, files[i])); | - | ||||||||||||||||||||||||||||||
| 448 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||||||||
| 449 | descriptors[i] = | - | ||||||||||||||||||||||||||||||
| 450 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 451 | ; | - | ||||||||||||||||||||||||||||||
| 452 | if (fail
| 3-5 | ||||||||||||||||||||||||||||||
| 453 | ok = executed 5 times by 1 test: ok = 0 ;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 454 | 0 executed 5 times by 1 test: ok = 0 ;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 455 | ; executed 5 times by 1 test: ok = 0 ;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 456 | n_outputs--; | - | ||||||||||||||||||||||||||||||
| 457 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||
| 458 | } executed 97 times by 1 test: end of blockExecuted by:
| 97 | ||||||||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||||||||
| 460 | if (bytes_read == -1
| 0-50 | ||||||||||||||||||||||||||||||
| 461 | { | - | ||||||||||||||||||||||||||||||
| 462 | error (0, | - | ||||||||||||||||||||||||||||||
| 463 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 464 | , | - | ||||||||||||||||||||||||||||||
| 465 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 466 | "read error" | - | ||||||||||||||||||||||||||||||
| 467 | , 5) | - | ||||||||||||||||||||||||||||||
| 468 | ); | - | ||||||||||||||||||||||||||||||
| 469 | ok = | - | ||||||||||||||||||||||||||||||
| 470 | 0 | - | ||||||||||||||||||||||||||||||
| 471 | ; | - | ||||||||||||||||||||||||||||||
| 472 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 473 | - | |||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||
| 475 | for (i = 1; i <= nfiles
| 50-70 | ||||||||||||||||||||||||||||||
| 476 | if (descriptors[i]
| 3-67 | ||||||||||||||||||||||||||||||
| 477 | rpl_fclose
| 0-67 | ||||||||||||||||||||||||||||||
| 478 | (descriptors[i]) != 0
| 0-67 | ||||||||||||||||||||||||||||||
| 479 | { | - | ||||||||||||||||||||||||||||||
| 480 | error (0, | - | ||||||||||||||||||||||||||||||
| 481 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 482 | , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, files[i])); | - | ||||||||||||||||||||||||||||||
| 483 | ok = | - | ||||||||||||||||||||||||||||||
| 484 | 0 | - | ||||||||||||||||||||||||||||||
| 485 | ; | - | ||||||||||||||||||||||||||||||
| 486 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||||||||
| 488 | free (descriptors); | - | ||||||||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||||||||
| 490 | return executed 50 times by 1 test: ok;return ok;Executed by:
executed 50 times by 1 test: return ok;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 491 | } | - | ||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |