| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/stdbuf.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | static char *program_path; | - | ||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | static struct | - | ||||||||||||||||||
| 13 | { | - | ||||||||||||||||||
| 14 | size_t size; | - | ||||||||||||||||||
| 15 | int optc; | - | ||||||||||||||||||
| 16 | char *optarg; | - | ||||||||||||||||||
| 17 | } stdbuf[3]; | - | ||||||||||||||||||
| 18 | - | |||||||||||||||||||
| 19 | static struct option const longopts[] = | - | ||||||||||||||||||
| 20 | { | - | ||||||||||||||||||
| 21 | {"input", | - | ||||||||||||||||||
| 22 | 1 | - | ||||||||||||||||||
| 23 | , | - | ||||||||||||||||||
| 24 | ((void *)0) | - | ||||||||||||||||||
| 25 | , 'i'}, | - | ||||||||||||||||||
| 26 | {"output", | - | ||||||||||||||||||
| 27 | 1 | - | ||||||||||||||||||
| 28 | , | - | ||||||||||||||||||
| 29 | ((void *)0) | - | ||||||||||||||||||
| 30 | , 'o'}, | - | ||||||||||||||||||
| 31 | {"error", | - | ||||||||||||||||||
| 32 | 1 | - | ||||||||||||||||||
| 33 | , | - | ||||||||||||||||||
| 34 | ((void *)0) | - | ||||||||||||||||||
| 35 | , 'e'}, | - | ||||||||||||||||||
| 36 | {"help", | - | ||||||||||||||||||
| 37 | 0 | - | ||||||||||||||||||
| 38 | , | - | ||||||||||||||||||
| 39 | ((void *)0) | - | ||||||||||||||||||
| 40 | , GETOPT_HELP_CHAR}, | - | ||||||||||||||||||
| 41 | {"version", | - | ||||||||||||||||||
| 42 | 0 | - | ||||||||||||||||||
| 43 | , | - | ||||||||||||||||||
| 44 | ((void *)0) | - | ||||||||||||||||||
| 45 | , GETOPT_VERSION_CHAR}, | - | ||||||||||||||||||
| 46 | { | - | ||||||||||||||||||
| 47 | ((void *)0) | - | ||||||||||||||||||
| 48 | , 0, | - | ||||||||||||||||||
| 49 | ((void *)0) | - | ||||||||||||||||||
| 50 | , 0} | - | ||||||||||||||||||
| 51 | }; | - | ||||||||||||||||||
| 52 | - | |||||||||||||||||||
| 53 | - | |||||||||||||||||||
| 54 | - | |||||||||||||||||||
| 55 | - | |||||||||||||||||||
| 56 | - | |||||||||||||||||||
| 57 | - | |||||||||||||||||||
| 58 | - | |||||||||||||||||||
| 59 | static int | - | ||||||||||||||||||
| 60 | parse_size (char const *str, size_t *size) | - | ||||||||||||||||||
| 61 | { | - | ||||||||||||||||||
| 62 | uintmax_t tmp_size; | - | ||||||||||||||||||
| 63 | enum strtol_error e = xstrtoumax (str, | - | ||||||||||||||||||
| 64 | ((void *)0) | - | ||||||||||||||||||
| 65 | , 10, &tmp_size, "EGkKMPTYZ0"); | - | ||||||||||||||||||
| 66 | if (e == LONGINT_OK
| 2-8 | ||||||||||||||||||
| 67 | (
| 0-2 | ||||||||||||||||||
| 68 | < tmp_size
| 0-2 | ||||||||||||||||||
| 69 | e = LONGINT_OVERFLOW; never executed: e = LONGINT_OVERFLOW; | 0 | ||||||||||||||||||
| 70 | - | |||||||||||||||||||
| 71 | if (e == LONGINT_OK
| 2-8 | ||||||||||||||||||
| 72 | { | - | ||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | (*__errno_location ()) | - | ||||||||||||||||||
| 75 | = 0; | - | ||||||||||||||||||
| 76 | *size = tmp_size; | - | ||||||||||||||||||
| 77 | return executed 2 times by 1 test: 0;return 0;Executed by:
executed 2 times by 1 test: return 0;Executed by:
| 2 | ||||||||||||||||||
| 78 | } | - | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | (*__errno_location ()) | - | ||||||||||||||||||
| 82 | = (e == LONGINT_OVERFLOW ? | - | ||||||||||||||||||
| 83 | 75 | - | ||||||||||||||||||
| 84 | : | - | ||||||||||||||||||
| 85 | (*__errno_location ()) | - | ||||||||||||||||||
| 86 | ); | - | ||||||||||||||||||
| 87 | return executed 8 times by 1 test: -1;return -1;Executed by:
executed 8 times by 1 test: return -1;Executed by:
| 8 | ||||||||||||||||||
| 88 | } | - | ||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | void | - | ||||||||||||||||||
| 91 | usage (int status) | - | ||||||||||||||||||
| 92 | { | - | ||||||||||||||||||
| 93 | if (status !=
| 3-5 | ||||||||||||||||||
| 94 | 0
| 3-5 | ||||||||||||||||||
| 95 | ) | - | ||||||||||||||||||
| 96 | do { fprintf ( | - | ||||||||||||||||||
| 97 | stderr | - | ||||||||||||||||||
| 98 | , | - | ||||||||||||||||||
| 99 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 100 | "Try '%s --help' for more information.\n" | - | ||||||||||||||||||
| 101 | , 5) | - | ||||||||||||||||||
| 102 | , program_name); } executed 5 times by 1 test: while (0);end of blockExecuted by:
| 5 | ||||||||||||||||||
| 103 | else | - | ||||||||||||||||||
| 104 | { | - | ||||||||||||||||||
| 105 | printf ( | - | ||||||||||||||||||
| 106 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 107 | "Usage: %s OPTION... COMMAND\n" | - | ||||||||||||||||||
| 108 | , 5) | - | ||||||||||||||||||
| 109 | , program_name); | - | ||||||||||||||||||
| 110 | fputs_unlocked ( | - | ||||||||||||||||||
| 111 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 112 | "Run COMMAND, with modified buffering operations for its standard streams.\n" | - | ||||||||||||||||||
| 113 | , 5) | - | ||||||||||||||||||
| 114 | , | - | ||||||||||||||||||
| 115 | stdout | - | ||||||||||||||||||
| 116 | ) | - | ||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | ; | - | ||||||||||||||||||
| 119 | - | |||||||||||||||||||
| 120 | emit_mandatory_arg_note (); | - | ||||||||||||||||||
| 121 | - | |||||||||||||||||||
| 122 | fputs_unlocked ( | - | ||||||||||||||||||
| 123 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 124 | " -i, --input=MODE adjust standard input stream buffering\n -o, --output=MODE adjust standard output stream buffering\n -e, --error=MODE adjust standard error stream buffering\n" | - | ||||||||||||||||||
| 125 | , 5) | - | ||||||||||||||||||
| 126 | , | - | ||||||||||||||||||
| 127 | stdout | - | ||||||||||||||||||
| 128 | ) | - | ||||||||||||||||||
| 129 | - | |||||||||||||||||||
| 130 | - | |||||||||||||||||||
| 131 | - | |||||||||||||||||||
| 132 | ; | - | ||||||||||||||||||
| 133 | fputs_unlocked ( | - | ||||||||||||||||||
| 134 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 135 | " --help display this help and exit\n" | - | ||||||||||||||||||
| 136 | , 5) | - | ||||||||||||||||||
| 137 | , | - | ||||||||||||||||||
| 138 | stdout | - | ||||||||||||||||||
| 139 | ); | - | ||||||||||||||||||
| 140 | fputs_unlocked ( | - | ||||||||||||||||||
| 141 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 142 | " --version output version information and exit\n" | - | ||||||||||||||||||
| 143 | , 5) | - | ||||||||||||||||||
| 144 | , | - | ||||||||||||||||||
| 145 | stdout | - | ||||||||||||||||||
| 146 | ); | - | ||||||||||||||||||
| 147 | fputs_unlocked ( | - | ||||||||||||||||||
| 148 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 149 | "\nIf MODE is 'L' the corresponding stream will be line buffered.\nThis option is invalid with standard input.\n" | - | ||||||||||||||||||
| 150 | , 5) | - | ||||||||||||||||||
| 151 | , | - | ||||||||||||||||||
| 152 | stdout | - | ||||||||||||||||||
| 153 | ) | - | ||||||||||||||||||
| 154 | - | |||||||||||||||||||
| 155 | ; | - | ||||||||||||||||||
| 156 | fputs_unlocked ( | - | ||||||||||||||||||
| 157 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 158 | "\nIf MODE is '0' the corresponding stream will be unbuffered.\n" | - | ||||||||||||||||||
| 159 | , 5) | - | ||||||||||||||||||
| 160 | , | - | ||||||||||||||||||
| 161 | stdout | - | ||||||||||||||||||
| 162 | ) | - | ||||||||||||||||||
| 163 | - | |||||||||||||||||||
| 164 | ; | - | ||||||||||||||||||
| 165 | fputs_unlocked ( | - | ||||||||||||||||||
| 166 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 167 | "\nOtherwise MODE is a number which may be followed by one of the following:\nKB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\nIn this case the corresponding stream will be fully buffered with the buffer\nsize set to MODE bytes.\n" | - | ||||||||||||||||||
| 168 | , 5) | - | ||||||||||||||||||
| 169 | , | - | ||||||||||||||||||
| 170 | stdout | - | ||||||||||||||||||
| 171 | ) | - | ||||||||||||||||||
| 172 | - | |||||||||||||||||||
| 173 | - | |||||||||||||||||||
| 174 | - | |||||||||||||||||||
| 175 | - | |||||||||||||||||||
| 176 | ; | - | ||||||||||||||||||
| 177 | fputs_unlocked ( | - | ||||||||||||||||||
| 178 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 179 | "\nNOTE: If COMMAND adjusts the buffering of its standard streams ('tee' does\nfor example) then that will override corresponding changes by 'stdbuf'.\nAlso some filters (like 'dd' and 'cat' etc.) don't use streams for I/O,\nand are thus unaffected by 'stdbuf' settings.\n" | - | ||||||||||||||||||
| 180 | , 5) | - | ||||||||||||||||||
| 181 | , | - | ||||||||||||||||||
| 182 | stdout | - | ||||||||||||||||||
| 183 | ) | - | ||||||||||||||||||
| 184 | - | |||||||||||||||||||
| 185 | - | |||||||||||||||||||
| 186 | - | |||||||||||||||||||
| 187 | - | |||||||||||||||||||
| 188 | ; | - | ||||||||||||||||||
| 189 | emit_ancillary_info ("stdbuf"); | - | ||||||||||||||||||
| 190 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||
| 191 | exit (status); executed 8 times by 1 test: exit (status);Executed by:
| 8 | ||||||||||||||||||
| 192 | } | - | ||||||||||||||||||
| 193 | - | |||||||||||||||||||
| 194 | - | |||||||||||||||||||
| 195 | - | |||||||||||||||||||
| 196 | - | |||||||||||||||||||
| 197 | - | |||||||||||||||||||
| 198 | - | |||||||||||||||||||
| 199 | - | |||||||||||||||||||
| 200 | static void | - | ||||||||||||||||||
| 201 | set_program_path (const char *arg) | - | ||||||||||||||||||
| 202 | { | - | ||||||||||||||||||
| 203 | if ( | - | ||||||||||||||||||
| 204 | (
| 0-2 | ||||||||||||||||||
| 205 | '/'
| 0-2 | ||||||||||||||||||
| 206 | )
| 0-2 | ||||||||||||||||||
| 207 | arg
| 0-2 | ||||||||||||||||||
| 208 | )
| 0-2 | ||||||||||||||||||
| 209 | '/'
| 0-2 | ||||||||||||||||||
| 210 | ) == '\0'
| 0-2 | ||||||||||||||||||
| 211 | arg
| 0-2 | ||||||||||||||||||
| 212 | ,
| 0-2 | ||||||||||||||||||
| 213 | '/'
| 0-2 | ||||||||||||||||||
| 214 | ) : __builtin_strchr (
| 0-2 | ||||||||||||||||||
| 215 | arg
| 0-2 | ||||||||||||||||||
| 216 | ,
| 0-2 | ||||||||||||||||||
| 217 | '/'
| 0-2 | ||||||||||||||||||
| 218 | )))
| 0-2 | ||||||||||||||||||
| 219 | ) | - | ||||||||||||||||||
| 220 | { | - | ||||||||||||||||||
| 221 | program_path = dir_name (arg); | - | ||||||||||||||||||
| 222 | } never executed: end of block | 0 | ||||||||||||||||||
| 223 | else | - | ||||||||||||||||||
| 224 | { | - | ||||||||||||||||||
| 225 | char *path = xreadlink ("/proc/self/exe"); | - | ||||||||||||||||||
| 226 | if (path
| 0-2 | ||||||||||||||||||
| 227 | program_path = dir_name (path); executed 2 times by 1 test: program_path = dir_name (path);Executed by:
| 2 | ||||||||||||||||||
| 228 | else if ((
| 0 | ||||||||||||||||||
| 229 | { | - | ||||||||||||||||||
| 230 | char *dir; | - | ||||||||||||||||||
| 231 | path = xstrdup (path); | - | ||||||||||||||||||
| 232 | for (dir = strtok (path, ":"); dir !=
| 0 | ||||||||||||||||||
| 233 | ((void *)0)
| 0 | ||||||||||||||||||
| 234 | ; dir = strtok ( | - | ||||||||||||||||||
| 235 | ((void *)0) | - | ||||||||||||||||||
| 236 | , ":")) | - | ||||||||||||||||||
| 237 | { | - | ||||||||||||||||||
| 238 | char *candidate = file_name_concat (dir, arg, | - | ||||||||||||||||||
| 239 | ((void *)0) | - | ||||||||||||||||||
| 240 | ); | - | ||||||||||||||||||
| 241 | if (access (candidate,
| 0 | ||||||||||||||||||
| 242 | 1
| 0 | ||||||||||||||||||
| 243 | ) == 0
| 0 | ||||||||||||||||||
| 244 | { | - | ||||||||||||||||||
| 245 | program_path = dir_name (candidate); | - | ||||||||||||||||||
| 246 | free (candidate); | - | ||||||||||||||||||
| 247 | break; never executed: break; | 0 | ||||||||||||||||||
| 248 | } | - | ||||||||||||||||||
| 249 | free (candidate); | - | ||||||||||||||||||
| 250 | } never executed: end of block | 0 | ||||||||||||||||||
| 251 | } never executed: end of block | 0 | ||||||||||||||||||
| 252 | free (path); | - | ||||||||||||||||||
| 253 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 254 | } | - | ||||||||||||||||||
| 255 | - | |||||||||||||||||||
| 256 | static int | - | ||||||||||||||||||
| 257 | optc_to_fileno (int c) | - | ||||||||||||||||||
| 258 | { | - | ||||||||||||||||||
| 259 | int ret = -1; | - | ||||||||||||||||||
| 260 | - | |||||||||||||||||||
| 261 | switch (c) | - | ||||||||||||||||||
| 262 | { | - | ||||||||||||||||||
| 263 | case executed 2 times by 1 test: 'e':case 'e':Executed by:
executed 2 times by 1 test: case 'e':Executed by:
| 2 | ||||||||||||||||||
| 264 | ret = | - | ||||||||||||||||||
| 265 | 2 | - | ||||||||||||||||||
| 266 | ; | - | ||||||||||||||||||
| 267 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 268 | case executed 3 times by 1 test: 'i':case 'i':Executed by:
executed 3 times by 1 test: case 'i':Executed by:
| 3 | ||||||||||||||||||
| 269 | ret = | - | ||||||||||||||||||
| 270 | 0 | - | ||||||||||||||||||
| 271 | ; | - | ||||||||||||||||||
| 272 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||
| 273 | case executed 6 times by 1 test: 'o':case 'o':Executed by:
executed 6 times by 1 test: case 'o':Executed by:
| 6 | ||||||||||||||||||
| 274 | ret = | - | ||||||||||||||||||
| 275 | 1 | - | ||||||||||||||||||
| 276 | ; | - | ||||||||||||||||||
| 277 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||
| 278 | } | - | ||||||||||||||||||
| 279 | - | |||||||||||||||||||
| 280 | return executed 11 times by 1 test: ret;return ret;Executed by:
executed 11 times by 1 test: return ret;Executed by:
| 11 | ||||||||||||||||||
| 281 | } | - | ||||||||||||||||||
| 282 | - | |||||||||||||||||||
| 283 | static void | - | ||||||||||||||||||
| 284 | set_LD_PRELOAD (void) | - | ||||||||||||||||||
| 285 | { | - | ||||||||||||||||||
| 286 | int ret; | - | ||||||||||||||||||
| 287 | - | |||||||||||||||||||
| 288 | - | |||||||||||||||||||
| 289 | - | |||||||||||||||||||
| 290 | char const *preload_env = "LD_PRELOAD"; | - | ||||||||||||||||||
| 291 | - | |||||||||||||||||||
| 292 | char *old_libs = getenv (preload_env); | - | ||||||||||||||||||
| 293 | char *LD_PRELOAD; | - | ||||||||||||||||||
| 294 | char const *const search_path[] = { | - | ||||||||||||||||||
| 295 | program_path, | - | ||||||||||||||||||
| 296 | "/usr/local/libexec/coreutils", | - | ||||||||||||||||||
| 297 | - | |||||||||||||||||||
| 298 | ((void *)0) | - | ||||||||||||||||||
| 299 | - | |||||||||||||||||||
| 300 | }; | - | ||||||||||||||||||
| 301 | - | |||||||||||||||||||
| 302 | char const *const *path = search_path; | - | ||||||||||||||||||
| 303 | char *libstdbuf; | - | ||||||||||||||||||
| 304 | - | |||||||||||||||||||
| 305 | while ( | - | ||||||||||||||||||
| 306 | 1 | - | ||||||||||||||||||
| 307 | ) | - | ||||||||||||||||||
| 308 | { | - | ||||||||||||||||||
| 309 | struct stat sb; | - | ||||||||||||||||||
| 310 | - | |||||||||||||||||||
| 311 | if (!**path
| 0-2 | ||||||||||||||||||
| 312 | { | - | ||||||||||||||||||
| 313 | libstdbuf = xstrdup ("libstdbuf.so"); | - | ||||||||||||||||||
| 314 | break; never executed: break; | 0 | ||||||||||||||||||
| 315 | } | - | ||||||||||||||||||
| 316 | ret = asprintf (&libstdbuf, "%s/%s", *path, "libstdbuf.so"); | - | ||||||||||||||||||
| 317 | if (ret < 0
| 0-2 | ||||||||||||||||||
| 318 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||
| 319 | if (stat (libstdbuf, &sb) == 0
| 0-2 | ||||||||||||||||||
| 320 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 321 | free (libstdbuf); | - | ||||||||||||||||||
| 322 | - | |||||||||||||||||||
| 323 | ++path; | - | ||||||||||||||||||
| 324 | if ( ! *path
| 0 | ||||||||||||||||||
| 325 | (( never executed: !!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CANCELED, 0, ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 326 | dcgettext (((void *)0), never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 327 | "failed to find %s" never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 328 | , 5) never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 329 | , quote ("libstdbuf.so")), (( never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 330 | 0 never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 331 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 332 | dcgettext (((void *)0), never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 333 | "failed to find %s" never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 334 | , 5) never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 335 | , quote ("libstdbuf.so")), (( never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 336 | 0 never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 337 | ) ? (void) 0 : __builtin_unreachable ())))); never executed: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, 0, dcgettext (((void *)0), \"failed to find %s\", 5), quote (\"libstdbuf.so\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CAN... "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, 0, dcgettext (((void *)0), "failed to find %s" , 5) , quote ("libstdbuf.so")), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||
| 338 | } never executed: end of block | 0 | ||||||||||||||||||
| 339 | - | |||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | - | |||||||||||||||||||
| 342 | if (old_libs
| 0-2 | ||||||||||||||||||
| 343 | ret = asprintf (&LD_PRELOAD, "%s=%s:%s", preload_env, old_libs, libstdbuf); never executed: ret = asprintf (&LD_PRELOAD, "%s=%s:%s", preload_env, old_libs, libstdbuf); | 0 | ||||||||||||||||||
| 344 | else | - | ||||||||||||||||||
| 345 | ret = asprintf (&LD_PRELOAD, "%s=%s", preload_env, libstdbuf); executed 2 times by 1 test: ret = asprintf (&LD_PRELOAD, "%s=%s", preload_env, libstdbuf);Executed by:
| 2 | ||||||||||||||||||
| 346 | - | |||||||||||||||||||
| 347 | if (ret < 0
| 0-2 | ||||||||||||||||||
| 348 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||
| 349 | - | |||||||||||||||||||
| 350 | free (libstdbuf); | - | ||||||||||||||||||
| 351 | - | |||||||||||||||||||
| 352 | ret = putenv (LD_PRELOAD); | - | ||||||||||||||||||
| 353 | - | |||||||||||||||||||
| 354 | - | |||||||||||||||||||
| 355 | - | |||||||||||||||||||
| 356 | - | |||||||||||||||||||
| 357 | - | |||||||||||||||||||
| 358 | if (ret != 0
| 0-2 | ||||||||||||||||||
| 359 | { | - | ||||||||||||||||||
| 360 | ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"failed to update the environment with %s\", 5), quote (LD_PRELOAD)), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CANCELED, | - | ||||||||||||||||||
| 361 | (*__errno_location ()) | - | ||||||||||||||||||
| 362 | , | - | ||||||||||||||||||
| 363 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 364 | "failed to update the environment with %s" | - | ||||||||||||||||||
| 365 | , 5) | - | ||||||||||||||||||
| 366 | , quote (LD_PRELOAD)), (( | - | ||||||||||||||||||
| 367 | 0 | - | ||||||||||||||||||
| 368 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, | - | ||||||||||||||||||
| 369 | (*__errno_location ()) | - | ||||||||||||||||||
| 370 | , | - | ||||||||||||||||||
| 371 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 372 | "failed to update the environment with %s" | - | ||||||||||||||||||
| 373 | , 5) | - | ||||||||||||||||||
| 374 | , quote (LD_PRELOAD)), (( | - | ||||||||||||||||||
| 375 | 0 | - | ||||||||||||||||||
| 376 | ) ? (void) 0 : __builtin_unreachable ())))) | - | ||||||||||||||||||
| 377 | - | |||||||||||||||||||
| 378 | ; | - | ||||||||||||||||||
| 379 | } never executed: end of block | 0 | ||||||||||||||||||
| 380 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 381 | - | |||||||||||||||||||
| 382 | - | |||||||||||||||||||
| 383 | - | |||||||||||||||||||
| 384 | - | |||||||||||||||||||
| 385 | static | - | ||||||||||||||||||
| 386 | _Bool | - | ||||||||||||||||||
| 387 | - | |||||||||||||||||||
| 388 | set_libstdbuf_options (void) | - | ||||||||||||||||||
| 389 | { | - | ||||||||||||||||||
| 390 | - | |||||||||||||||||||
| 391 | _Bool | - | ||||||||||||||||||
| 392 | env_set = | - | ||||||||||||||||||
| 393 | 0 | - | ||||||||||||||||||
| 394 | ; | - | ||||||||||||||||||
| 395 | - | |||||||||||||||||||
| 396 | for (size_t i = 0; i < (sizeof (stdbuf) / sizeof *(stdbuf))
| 3-9 | ||||||||||||||||||
| 397 | { | - | ||||||||||||||||||
| 398 | if (stdbuf[i].optarg
| 2-7 | ||||||||||||||||||
| 399 | { | - | ||||||||||||||||||
| 400 | char *var; | - | ||||||||||||||||||
| 401 | int ret; | - | ||||||||||||||||||
| 402 | - | |||||||||||||||||||
| 403 | if (*
| 0-2 | ||||||||||||||||||
| 404 | ret = asprintf (&var, "%s%c=L", "_STDBUF_", never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 405 | never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 406 | (__extension__ ({ int __res; if (sizeof (
never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 407 | stdbuf[i].optc
never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 408 | ) > 1
never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 409 | stdbuf[i].optc
never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 410 | )
never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 411 | stdbuf[i].optc never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 412 | ); __res = __c < -128
never executed: else __res = toupper (end of blocknever executed: __res = toupper ( stdbuf[i].optc );never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 413 | stdbuf[i].optc never executed: __res = toupper ( stdbuf[i].optc );never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 414 | ); never executed: } else __res = (*__ctype_toupper_loc ())[(int) (__res = toupper ( stdbuf[i].optc );never executed: __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )];never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 415 | stdbuf[i].optc never executed: __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )];never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 416 | )]; never executed: __res; }))__res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )];never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 417 | ); never executed: ret = asprintf (&var, "%s%c=L", "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) ); | 0 | ||||||||||||||||||
| 418 | else | - | ||||||||||||||||||
| 419 | ret = asprintf (&var, "%s%c=%" executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 420 | "l" "u" executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 421 | , "_STDBUF_", executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 422 | executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 423 | (__extension__ ({ int __res; if (sizeof (
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 424 | stdbuf[i].optc
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 425 | ) > 1
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 426 | stdbuf[i].optc
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 427 | )
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 428 | stdbuf[i].optc executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 429 | ); __res = __c < -128
never executed: else __res = toupper (end of blockexecuted 2 times by 1 test: __res = toupper ( stdbuf[i].optc );Executed by:
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 430 | stdbuf[i].optc executed 2 times by 1 test: __res = toupper ( stdbuf[i].optc );Executed by:
executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 431 | ); executed 2 times by 1 test: } else __res = (*__ctype_toupper_loc ())[(int) (__res = toupper ( stdbuf[i].optc );Executed by:
never executed: __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )];executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 432 | stdbuf[i].optc never executed: __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )];executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 433 | )]; never executed: __res; }))__res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )];executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 0-2 | ||||||||||||||||||
| 434 | , executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 435 | (uintmax_t) stdbuf[i].size); executed 2 times by 1 test: ret = asprintf (&var, "%s%c=%" "l" "u" , "_STDBUF_", (__extension__ ({ int __res; if (sizeof ( stdbuf[i].optc ) > 1) { if (__builtin_constant_p ( stdbuf[i].optc )) { int __c = ( stdbuf[i].optc ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( stdbuf[i].optc ); } else __res = (*__ctype_toupper_loc ())[(int) ( stdbuf[i].optc )]; __res; })) , (uintmax_t) stdbuf[i].size);Executed by:
| 2 | ||||||||||||||||||
| 436 | if (ret < 0
| 0-2 | ||||||||||||||||||
| 437 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||
| 438 | - | |||||||||||||||||||
| 439 | if (putenv (var) != 0
| 0-2 | ||||||||||||||||||
| 440 | { | - | ||||||||||||||||||
| 441 | ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"failed to update the environment with %s\", 5), quote (var)), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CANCELED, | - | ||||||||||||||||||
| 442 | (*__errno_location ()) | - | ||||||||||||||||||
| 443 | , | - | ||||||||||||||||||
| 444 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 445 | "failed to update the environment with %s" | - | ||||||||||||||||||
| 446 | , 5) | - | ||||||||||||||||||
| 447 | , quote (var)), (( | - | ||||||||||||||||||
| 448 | 0 | - | ||||||||||||||||||
| 449 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, | - | ||||||||||||||||||
| 450 | (*__errno_location ()) | - | ||||||||||||||||||
| 451 | , | - | ||||||||||||||||||
| 452 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 453 | "failed to update the environment with %s" | - | ||||||||||||||||||
| 454 | , 5) | - | ||||||||||||||||||
| 455 | , quote (var)), (( | - | ||||||||||||||||||
| 456 | 0 | - | ||||||||||||||||||
| 457 | ) ? (void) 0 : __builtin_unreachable ())))) | - | ||||||||||||||||||
| 458 | - | |||||||||||||||||||
| 459 | ; | - | ||||||||||||||||||
| 460 | } never executed: end of block | 0 | ||||||||||||||||||
| 461 | - | |||||||||||||||||||
| 462 | env_set = | - | ||||||||||||||||||
| 463 | 1 | - | ||||||||||||||||||
| 464 | ; | - | ||||||||||||||||||
| 465 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 466 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||
| 467 | - | |||||||||||||||||||
| 468 | return executed 3 times by 1 test: env_set;return env_set;Executed by:
executed 3 times by 1 test: return env_set;Executed by:
| 3 | ||||||||||||||||||
| 469 | } | - | ||||||||||||||||||
| 470 | - | |||||||||||||||||||
| 471 | int | - | ||||||||||||||||||
| 472 | main (int argc, char **argv) | - | ||||||||||||||||||
| 473 | { | - | ||||||||||||||||||
| 474 | int c; | - | ||||||||||||||||||
| 475 | - | |||||||||||||||||||
| 476 | ; | - | ||||||||||||||||||
| 477 | set_program_name (argv[0]); | - | ||||||||||||||||||
| 478 | setlocale ( | - | ||||||||||||||||||
| 479 | 6 | - | ||||||||||||||||||
| 480 | , ""); | - | ||||||||||||||||||
| 481 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||||||||||||||
| 482 | textdomain ("coreutils"); | - | ||||||||||||||||||
| 483 | - | |||||||||||||||||||
| 484 | initialize_exit_failure (EXIT_CANCELED); | - | ||||||||||||||||||
| 485 | atexit (close_stdout); | - | ||||||||||||||||||
| 486 | - | |||||||||||||||||||
| 487 | while ((
| 3-21 | ||||||||||||||||||
| 488 | ((void *)0)
| 3-21 | ||||||||||||||||||
| 489 | )) != -1
| 3-21 | ||||||||||||||||||
| 490 | { | - | ||||||||||||||||||
| 491 | int opt_fileno; | - | ||||||||||||||||||
| 492 | - | |||||||||||||||||||
| 493 | switch (c) | - | ||||||||||||||||||
| 494 | { | - | ||||||||||||||||||
| 495 | - | |||||||||||||||||||
| 496 | case executed 2 times by 1 test: 'e':case 'e':Executed by:
executed 2 times by 1 test: case 'e':Executed by:
| 2 | ||||||||||||||||||
| 497 | case executed 3 times by 1 test: 'i':case 'i':Executed by:
executed 3 times by 1 test: case 'i':Executed by:
| 3 | ||||||||||||||||||
| 498 | case executed 6 times by 1 test: 'o':case 'o':Executed by:
executed 6 times by 1 test: case 'o':Executed by:
| 6 | ||||||||||||||||||
| 499 | opt_fileno = optc_to_fileno (c); | - | ||||||||||||||||||
| 500 | - | |||||||||||||||||||
| 501 | (( | - | ||||||||||||||||||
| 502 | 0 <= opt_fileno && opt_fileno < (sizeof (stdbuf) / sizeof *(stdbuf)) | - | ||||||||||||||||||
| 503 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||||||||
| 504 | "0 <= opt_fileno && opt_fileno < ARRAY_CARDINALITY (stdbuf)" | - | ||||||||||||||||||
| 505 | , "src/stdbuf.c", 335, __PRETTY_FUNCTION__)) | - | ||||||||||||||||||
| 506 | ; | - | ||||||||||||||||||
| 507 | stdbuf[opt_fileno].optc = c; | - | ||||||||||||||||||
| 508 | while (c_isspace (*optarg)
| 0-11 | ||||||||||||||||||
| 509 | optarg++; never executed: optarg++; | 0 | ||||||||||||||||||
| 510 | stdbuf[opt_fileno].optarg = optarg; | - | ||||||||||||||||||
| 511 | if (c == 'i'
| 1-8 | ||||||||||||||||||
| 512 | { | - | ||||||||||||||||||
| 513 | - | |||||||||||||||||||
| 514 | - | |||||||||||||||||||
| 515 | - | |||||||||||||||||||
| 516 | error (0, 0, | - | ||||||||||||||||||
| 517 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 518 | "line buffering stdin is meaningless" | - | ||||||||||||||||||
| 519 | , 5) | - | ||||||||||||||||||
| 520 | ); | - | ||||||||||||||||||
| 521 | usage (EXIT_CANCELED); | - | ||||||||||||||||||
| 522 | } never executed: end of block | 0 | ||||||||||||||||||
| 523 | - | |||||||||||||||||||
| 524 | if (!(
| 0-10 | ||||||||||||||||||
| 525 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 0-10 | ||||||||||||||||||
| 526 | optarg
| 0-10 | ||||||||||||||||||
| 527 | ) && __builtin_constant_p (
| 0-10 | ||||||||||||||||||
| 528 | "L"
| 0-10 | ||||||||||||||||||
| 529 | ) && (__s1_len = __builtin_strlen (
| 0-10 | ||||||||||||||||||
| 530 | optarg
| 0-10 | ||||||||||||||||||
| 531 | ), __s2_len = __builtin_strlen (
| 0-10 | ||||||||||||||||||
| 532 | "L"
| 0-10 | ||||||||||||||||||
| 533 | ), (!((size_t)(const void *)((
| 0-10 | ||||||||||||||||||
| 534 | optarg
| 0-10 | ||||||||||||||||||
| 535 | ) + 1) - (size_t)(const void *)(
| 0-10 | ||||||||||||||||||
| 536 | optarg
| 0-10 | ||||||||||||||||||
| 537 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 0-10 | ||||||||||||||||||
| 538 | "L"
| 0-10 | ||||||||||||||||||
| 539 | ) + 1) - (size_t)(const void *)(
| 0-10 | ||||||||||||||||||
| 540 | "L"
| 0-10 | ||||||||||||||||||
| 541 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 0-10 | ||||||||||||||||||
| 542 | optarg
| 0-10 | ||||||||||||||||||
| 543 | ,
| 0-10 | ||||||||||||||||||
| 544 | "L"
| 0-10 | ||||||||||||||||||
| 545 | ) : (__builtin_constant_p (
| 0-10 | ||||||||||||||||||
| 546 | optarg
| 0-10 | ||||||||||||||||||
| 547 | ) && ((size_t)(const void *)((
| 0-10 | ||||||||||||||||||
| 548 | optarg
| 0-10 | ||||||||||||||||||
| 549 | ) + 1) - (size_t)(const void *)(
| 0-10 | ||||||||||||||||||
| 550 | optarg
| 0-10 | ||||||||||||||||||
| 551 | ) == 1) && (__s1_len = __builtin_strlen (
| 0-10 | ||||||||||||||||||
| 552 | optarg
| 0-10 | ||||||||||||||||||
| 553 | ), __s1_len < 4) ? (__builtin_constant_p (
| 0-10 | ||||||||||||||||||
| 554 | "L"
| 0-10 | ||||||||||||||||||
| 555 | ) && ((size_t)(const void *)((
| 0-10 | ||||||||||||||||||
| 556 | "L"
| 0-10 | ||||||||||||||||||
| 557 | ) + 1) - (size_t)(const void *)(
| 0-10 | ||||||||||||||||||
| 558 | "L"
| 0-10 | ||||||||||||||||||
| 559 | ) == 1) ? __builtin_strcmp (
| 0-10 | ||||||||||||||||||
| 560 | optarg
| 0-10 | ||||||||||||||||||
| 561 | ,
| 0-10 | ||||||||||||||||||
| 562 | "L"
| 0-10 | ||||||||||||||||||
| 563 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-10 | ||||||||||||||||||
| 564 | "L"
| 0-10 | ||||||||||||||||||
| 565 | ); int __result = (((const unsigned char *) (const char *) (
| 0-10 | ||||||||||||||||||
| 566 | optarg
| 0-10 | ||||||||||||||||||
| 567 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-10 | ||||||||||||||||||
| 568 | optarg
| 0-10 | ||||||||||||||||||
| 569 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-10 | ||||||||||||||||||
| 570 | optarg
| 0-10 | ||||||||||||||||||
| 571 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( optarg ))[3] - __s2[3]);
| 0-10 | ||||||||||||||||||
| 572 | optarg
never executed: __result = (((const unsigned char *) (const char *) ( optarg ))[3] - __s2[3]); | 0-10 | ||||||||||||||||||
| 573 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( optarg ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-10 | ||||||||||||||||||
| 574 | "L"
| 0-10 | ||||||||||||||||||
| 575 | ) && ((size_t)(const void *)((
| 0-10 | ||||||||||||||||||
| 576 | "L"
| 0-10 | ||||||||||||||||||
| 577 | ) + 1) - (size_t)(const void *)(
| 0-10 | ||||||||||||||||||
| 578 | "L"
| 0-10 | ||||||||||||||||||
| 579 | ) == 1) && (__s2_len = __builtin_strlen (
| 0-10 | ||||||||||||||||||
| 580 | "L"
| 0-10 | ||||||||||||||||||
| 581 | ), __s2_len < 4) ? (__builtin_constant_p (
| 0-10 | ||||||||||||||||||
| 582 | optarg
| 0-10 | ||||||||||||||||||
| 583 | ) && ((size_t)(const void *)((
| 0-10 | ||||||||||||||||||
| 584 | optarg
| 0-10 | ||||||||||||||||||
| 585 | ) + 1) - (size_t)(const void *)(
| 0-10 | ||||||||||||||||||
| 586 | optarg
| 0-10 | ||||||||||||||||||
| 587 | ) == 1) ? __builtin_strcmp (
| 0-10 | ||||||||||||||||||
| 588 | optarg
| 0-10 | ||||||||||||||||||
| 589 | ,
| 0-10 | ||||||||||||||||||
| 590 | "L"
| 0-10 | ||||||||||||||||||
| 591 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-10 | ||||||||||||||||||
| 592 | optarg
| 0-10 | ||||||||||||||||||
| 593 | ); int __result = (((const unsigned char *) (const char *) (
| 0-10 | ||||||||||||||||||
| 594 | "L"
| 0-10 | ||||||||||||||||||
| 595 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-10 | ||||||||||||||||||
| 596 | "L"
| 0-10 | ||||||||||||||||||
| 597 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-10 | ||||||||||||||||||
| 598 | "L"
| 0-10 | ||||||||||||||||||
| 599 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "L" ))[3] - __s2[3]);
| 0-10 | ||||||||||||||||||
| 600 | "L"
never executed: __result = (((const unsigned char *) (const char *) ( "L" ))[3] - __s2[3]); | 0-10 | ||||||||||||||||||
| 601 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( "L" ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : __builtin_strcmp (end of block
| 0-10 | ||||||||||||||||||
| 602 | optarg
| 0-10 | ||||||||||||||||||
| 603 | ,
| 0-10 | ||||||||||||||||||
| 604 | "L"
| 0-10 | ||||||||||||||||||
| 605 | )))); })
| 0-10 | ||||||||||||||||||
| 606 | == 0)
| 0-10 | ||||||||||||||||||
| 607 | && parse_size (optarg, &stdbuf[opt_fileno].size) == -1
| 2-8 | ||||||||||||||||||
| 608 | (( executed 8 times by 1 test: !!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error (EXIT_CANCELED, ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 609 | (*__errno_location ()) executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 610 | , executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 611 | dcgettext (((void *)0), executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 612 | "invalid mode %s" executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 613 | , 5) executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 614 | , quote (optarg)), (( executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 615 | 0 executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 616 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 617 | (*__errno_location ()) executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 618 | , executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 619 | dcgettext (((void *)0), executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 620 | "invalid mode %s" executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 621 | , 5) executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 622 | , quote (optarg)), (( executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 623 | 0 executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 624 | ) ? (void) 0 : __builtin_unreachable ())))); executed 8 times by 1 test: ((!!sizeof (struct { _Static_assert (EXIT_CANCELED, "verify_expr (" "EXIT_CANCELED" ", " "(error (EXIT_CANCELED, (*__errno_location ()), dcgettext (((void *)0), \"invalid mode %s\", 5), quote (optarg)), assume (false))" ")"); int _gl_dummy; })) ? ((error ...invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (EXIT_CANCELED, (*__errno_location ()) , dcgettext (((void *)0), "invalid mode %s" , 5) , quote (optarg)), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));Executed by:
| 8 | ||||||||||||||||||
| 625 | - | |||||||||||||||||||
| 626 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 627 | - | |||||||||||||||||||
| 628 | case executed 3 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 3 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 3 | ||||||||||||||||||
| 629 | 0 | - | ||||||||||||||||||
| 630 | ); break; never executed: ;break; | 0 | ||||||||||||||||||
| 631 | - | |||||||||||||||||||
| 632 | 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 | ||||||||||||||||||
| 633 | stdout | - | ||||||||||||||||||
| 634 | , "stdbuf", "GNU coreutils", Version, ("Padraig Brady"), (char *) | - | ||||||||||||||||||
| 635 | ((void *)0) | - | ||||||||||||||||||
| 636 | ); exit ( executed 4 times by 1 test: exit ( 0 );Executed by:
| 4 | ||||||||||||||||||
| 637 | 0 executed 4 times by 1 test: exit ( 0 );Executed by:
| 4 | ||||||||||||||||||
| 638 | ); executed 4 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-4 | ||||||||||||||||||
| 639 | - | |||||||||||||||||||
| 640 | default executed 3 times by 1 test: :default:Executed by:
executed 3 times by 1 test: default:Executed by:
| 3 | ||||||||||||||||||
| 641 | usage (EXIT_CANCELED); | - | ||||||||||||||||||
| 642 | } never executed: end of block | 0 | ||||||||||||||||||
| 643 | } | - | ||||||||||||||||||
| 644 | - | |||||||||||||||||||
| 645 | argv += optind; | - | ||||||||||||||||||
| 646 | argc -= optind; | - | ||||||||||||||||||
| 647 | - | |||||||||||||||||||
| 648 | - | |||||||||||||||||||
| 649 | if (argc < 1
| 0-3 | ||||||||||||||||||
| 650 | { | - | ||||||||||||||||||
| 651 | error (0, 0, | - | ||||||||||||||||||
| 652 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 653 | "missing operand" | - | ||||||||||||||||||
| 654 | , 5) | - | ||||||||||||||||||
| 655 | ); | - | ||||||||||||||||||
| 656 | usage (EXIT_CANCELED); | - | ||||||||||||||||||
| 657 | } never executed: end of block | 0 | ||||||||||||||||||
| 658 | - | |||||||||||||||||||
| 659 | if (! set_libstdbuf_options ()
| 1-2 | ||||||||||||||||||
| 660 | { | - | ||||||||||||||||||
| 661 | error (0, 0, | - | ||||||||||||||||||
| 662 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 663 | "you must specify a buffering mode option" | - | ||||||||||||||||||
| 664 | , 5) | - | ||||||||||||||||||
| 665 | ); | - | ||||||||||||||||||
| 666 | usage (EXIT_CANCELED); | - | ||||||||||||||||||
| 667 | } never executed: end of block | 0 | ||||||||||||||||||
| 668 | - | |||||||||||||||||||
| 669 | - | |||||||||||||||||||
| 670 | - | |||||||||||||||||||
| 671 | set_program_path (program_name); | - | ||||||||||||||||||
| 672 | if (!program_path
| 0-2 | ||||||||||||||||||
| 673 | program_path = xstrdup ("/usr/local/lib/coreutils"); never executed: program_path = xstrdup ("/usr/local/lib/coreutils"); | 0 | ||||||||||||||||||
| 674 | set_LD_PRELOAD (); | - | ||||||||||||||||||
| 675 | free (program_path); | - | ||||||||||||||||||
| 676 | - | |||||||||||||||||||
| 677 | execvp (*argv, argv); | - | ||||||||||||||||||
| 678 | - | |||||||||||||||||||
| 679 | int exit_status = | - | ||||||||||||||||||
| 680 | (*
| 1 | ||||||||||||||||||
| 681 | ==
| 1 | ||||||||||||||||||
| 682 | 2
| 1 | ||||||||||||||||||
| 683 | ? EXIT_ENOENT : EXIT_CANNOT_INVOKE; | - | ||||||||||||||||||
| 684 | error (0, | - | ||||||||||||||||||
| 685 | (*__errno_location ()) | - | ||||||||||||||||||
| 686 | , | - | ||||||||||||||||||
| 687 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 688 | "failed to run command %s" | - | ||||||||||||||||||
| 689 | , 5) | - | ||||||||||||||||||
| 690 | , quote (argv[0])); | - | ||||||||||||||||||
| 691 | return executed 2 times by 1 test: exit_status;return exit_status;Executed by:
executed 2 times by 1 test: return exit_status;Executed by:
| 2 | ||||||||||||||||||
| 692 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |