| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/kill.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | static char const short_options[] = | - | ||||||||||||||||||||||||
| 3 | "0::1::2::3::4::5::6::7::8::9::" | - | ||||||||||||||||||||||||
| 4 | "A::B::C::D::E::F::G::H::I::J::K::M::" | - | ||||||||||||||||||||||||
| 5 | "N::O::P::Q::R::S::T::U::V::W::X::Y::Z::" | - | ||||||||||||||||||||||||
| 6 | "Lln:s:t"; | - | ||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | static struct option const long_options[] = | - | ||||||||||||||||||||||||
| 9 | { | - | ||||||||||||||||||||||||
| 10 | {"list", | - | ||||||||||||||||||||||||
| 11 | 0 | - | ||||||||||||||||||||||||
| 12 | , | - | ||||||||||||||||||||||||
| 13 | ((void *)0) | - | ||||||||||||||||||||||||
| 14 | , 'l'}, | - | ||||||||||||||||||||||||
| 15 | {"signal", | - | ||||||||||||||||||||||||
| 16 | 1 | - | ||||||||||||||||||||||||
| 17 | , | - | ||||||||||||||||||||||||
| 18 | ((void *)0) | - | ||||||||||||||||||||||||
| 19 | , 's'}, | - | ||||||||||||||||||||||||
| 20 | {"table", | - | ||||||||||||||||||||||||
| 21 | 0 | - | ||||||||||||||||||||||||
| 22 | , | - | ||||||||||||||||||||||||
| 23 | ((void *)0) | - | ||||||||||||||||||||||||
| 24 | , 't'}, | - | ||||||||||||||||||||||||
| 25 | {"help", | - | ||||||||||||||||||||||||
| 26 | 0 | - | ||||||||||||||||||||||||
| 27 | , | - | ||||||||||||||||||||||||
| 28 | ((void *)0) | - | ||||||||||||||||||||||||
| 29 | , GETOPT_HELP_CHAR}, | - | ||||||||||||||||||||||||
| 30 | {"version", | - | ||||||||||||||||||||||||
| 31 | 0 | - | ||||||||||||||||||||||||
| 32 | , | - | ||||||||||||||||||||||||
| 33 | ((void *)0) | - | ||||||||||||||||||||||||
| 34 | , GETOPT_VERSION_CHAR}, | - | ||||||||||||||||||||||||
| 35 | { | - | ||||||||||||||||||||||||
| 36 | ((void *)0) | - | ||||||||||||||||||||||||
| 37 | , 0, | - | ||||||||||||||||||||||||
| 38 | ((void *)0) | - | ||||||||||||||||||||||||
| 39 | , 0} | - | ||||||||||||||||||||||||
| 40 | }; | - | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | void | - | ||||||||||||||||||||||||
| 43 | usage (int status) | - | ||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||
| 45 | if (status !=
| 2-8 | ||||||||||||||||||||||||
| 46 | 0
| 2-8 | ||||||||||||||||||||||||
| 47 | ) | - | ||||||||||||||||||||||||
| 48 | do { fprintf ( | - | ||||||||||||||||||||||||
| 49 | stderr | - | ||||||||||||||||||||||||
| 50 | , | - | ||||||||||||||||||||||||
| 51 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 52 | "Try '%s --help' for more information.\n" | - | ||||||||||||||||||||||||
| 53 | , 5) | - | ||||||||||||||||||||||||
| 54 | , program_name); } executed 8 times by 1 test: while (0);end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 55 | else | - | ||||||||||||||||||||||||
| 56 | { | - | ||||||||||||||||||||||||
| 57 | printf ( | - | ||||||||||||||||||||||||
| 58 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 59 | "Usage: %s [-s SIGNAL | -SIGNAL] PID...\n or: %s -l [SIGNAL]...\n or: %s -t [SIGNAL]...\n" | - | ||||||||||||||||||||||||
| 60 | , 5) | - | ||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||
| 65 | , | - | ||||||||||||||||||||||||
| 66 | program_name, program_name, program_name); | - | ||||||||||||||||||||||||
| 67 | fputs_unlocked ( | - | ||||||||||||||||||||||||
| 68 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 69 | "Send signals to processes, or list signals.\n" | - | ||||||||||||||||||||||||
| 70 | , 5) | - | ||||||||||||||||||||||||
| 71 | , | - | ||||||||||||||||||||||||
| 72 | stdout | - | ||||||||||||||||||||||||
| 73 | ) | - | ||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | ; | - | ||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| 77 | emit_mandatory_arg_note (); | - | ||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||
| 79 | fputs_unlocked ( | - | ||||||||||||||||||||||||
| 80 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 81 | " -s, --signal=SIGNAL, -SIGNAL\n specify the name or number of the signal to be sent\n -l, --list list signal names, or convert signal names to/from numbers\n -t, --table print a table of signal information\n" | - | ||||||||||||||||||||||||
| 82 | , 5) | - | ||||||||||||||||||||||||
| 83 | , | - | ||||||||||||||||||||||||
| 84 | stdout | - | ||||||||||||||||||||||||
| 85 | ) | - | ||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | ; | - | ||||||||||||||||||||||||
| 91 | fputs_unlocked ( | - | ||||||||||||||||||||||||
| 92 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 93 | " --help display this help and exit\n" | - | ||||||||||||||||||||||||
| 94 | , 5) | - | ||||||||||||||||||||||||
| 95 | , | - | ||||||||||||||||||||||||
| 96 | stdout | - | ||||||||||||||||||||||||
| 97 | ); | - | ||||||||||||||||||||||||
| 98 | fputs_unlocked ( | - | ||||||||||||||||||||||||
| 99 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 100 | " --version output version information and exit\n" | - | ||||||||||||||||||||||||
| 101 | , 5) | - | ||||||||||||||||||||||||
| 102 | , | - | ||||||||||||||||||||||||
| 103 | stdout | - | ||||||||||||||||||||||||
| 104 | ); | - | ||||||||||||||||||||||||
| 105 | fputs_unlocked ( | - | ||||||||||||||||||||||||
| 106 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 107 | "\nSIGNAL may be a signal name like 'HUP', or a signal number like '1',\nor the exit status of a process terminated by a signal.\nPID is an integer; if negative it identifies a process group.\n" | - | ||||||||||||||||||||||||
| 108 | , 5) | - | ||||||||||||||||||||||||
| 109 | , | - | ||||||||||||||||||||||||
| 110 | stdout | - | ||||||||||||||||||||||||
| 111 | ) | - | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||
| 115 | ; | - | ||||||||||||||||||||||||
| 116 | printf ( | - | ||||||||||||||||||||||||
| 117 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 118 | "\n" "NOTE: your shell may have its own version of %s, which usually supersedes\n" "the version described here. Please refer to your shell's documentation\n" "for details about the options it supports.\n" | - | ||||||||||||||||||||||||
| 119 | , 5) | - | ||||||||||||||||||||||||
| 120 | , "kill"); | - | ||||||||||||||||||||||||
| 121 | emit_ancillary_info ("kill"); | - | ||||||||||||||||||||||||
| 122 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 123 | exit (status); executed 10 times by 1 test: exit (status);Executed by:
| 10 | ||||||||||||||||||||||||
| 124 | } | - | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | static void | - | ||||||||||||||||||||||||
| 131 | print_table_row (int num_width, int signum, | - | ||||||||||||||||||||||||
| 132 | int name_width, char const *signame) | - | ||||||||||||||||||||||||
| 133 | { | - | ||||||||||||||||||||||||
| 134 | char const *description = strsignal (signum); | - | ||||||||||||||||||||||||
| 135 | printf ("%*d %-*s %s\n", num_width, signum, name_width, signame, | - | ||||||||||||||||||||||||
| 136 | description ? description : "?"); | - | ||||||||||||||||||||||||
| 137 | } executed 126 times by 1 test: end of blockExecuted by:
| 126 | ||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||
| 140 | - | |||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | - | |||||||||||||||||||||||||
| 143 | static int | - | ||||||||||||||||||||||||
| 144 | list_signals ( | - | ||||||||||||||||||||||||
| 145 | _Bool | - | ||||||||||||||||||||||||
| 146 | table, char *const *argv) | - | ||||||||||||||||||||||||
| 147 | { | - | ||||||||||||||||||||||||
| 148 | int signum; | - | ||||||||||||||||||||||||
| 149 | int status = | - | ||||||||||||||||||||||||
| 150 | 0 | - | ||||||||||||||||||||||||
| 151 | ; | - | ||||||||||||||||||||||||
| 152 | char signame[(sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1)]; | - | ||||||||||||||||||||||||
| 153 | - | |||||||||||||||||||||||||
| 154 | if (table
| 3-7 | ||||||||||||||||||||||||
| 155 | { | - | ||||||||||||||||||||||||
| 156 | unsigned int name_width = 0; | - | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||
| 159 | unsigned int num_width = 1; | - | ||||||||||||||||||||||||
| 160 | for (signum = 1; signum <= (
| 3 | ||||||||||||||||||||||||
| 161 | 65
| 3 | ||||||||||||||||||||||||
| 162 | - 1) / 10
| 3 | ||||||||||||||||||||||||
| 163 | num_width++; executed 3 times by 1 test: num_width++;Executed by:
| 3 | ||||||||||||||||||||||||
| 164 | - | |||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||
| 166 | for (signum = 1; signum <= (
| 3-192 | ||||||||||||||||||||||||
| 167 | 65
| 3-192 | ||||||||||||||||||||||||
| 168 | - 1)
| 3-192 | ||||||||||||||||||||||||
| 169 | if (sig2str (signum, signame) == 0
| 6-186 | ||||||||||||||||||||||||
| 170 | { | - | ||||||||||||||||||||||||
| 171 | size_t len = strlen (signame); | - | ||||||||||||||||||||||||
| 172 | if (name_width < len
| 15-171 | ||||||||||||||||||||||||
| 173 | name_width = len; executed 15 times by 1 test: name_width = len;Executed by:
| 15 | ||||||||||||||||||||||||
| 174 | } executed 186 times by 1 test: end of blockExecuted by:
| 186 | ||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||
| 176 | if (argv
| 1-2 | ||||||||||||||||||||||||
| 177 | for (; *
| 1-2 | ||||||||||||||||||||||||
| 178 | { | - | ||||||||||||||||||||||||
| 179 | signum = operand2sig (*argv, signame); | - | ||||||||||||||||||||||||
| 180 | if (signum < 0
| 0-2 | ||||||||||||||||||||||||
| 181 | status = never executed: status = 1 ; | 0 | ||||||||||||||||||||||||
| 182 | 1 never executed: status = 1 ; | 0 | ||||||||||||||||||||||||
| 183 | ; never executed: status = 1 ; | 0 | ||||||||||||||||||||||||
| 184 | else | - | ||||||||||||||||||||||||
| 185 | print_table_row (num_width, signum, name_width, signame); executed 2 times by 1 test: print_table_row (num_width, signum, name_width, signame);Executed by:
| 2 | ||||||||||||||||||||||||
| 186 | } | - | ||||||||||||||||||||||||
| 187 | else | - | ||||||||||||||||||||||||
| 188 | for (signum = 1; signum <= (
| 2-128 | ||||||||||||||||||||||||
| 189 | 65
| 2-128 | ||||||||||||||||||||||||
| 190 | - 1)
| 2-128 | ||||||||||||||||||||||||
| 191 | if (sig2str (signum, signame) == 0
| 4-124 | ||||||||||||||||||||||||
| 192 | print_table_row (num_width, signum, name_width, signame); executed 124 times by 1 test: print_table_row (num_width, signum, name_width, signame);Executed by:
| 124 | ||||||||||||||||||||||||
| 193 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 194 | else | - | ||||||||||||||||||||||||
| 195 | { | - | ||||||||||||||||||||||||
| 196 | if (argv
| 1-6 | ||||||||||||||||||||||||
| 197 | for (; *
| 6-10 | ||||||||||||||||||||||||
| 198 | { | - | ||||||||||||||||||||||||
| 199 | signum = operand2sig (*argv, signame); | - | ||||||||||||||||||||||||
| 200 | if (signum < 0
| 3-7 | ||||||||||||||||||||||||
| 201 | status = executed 3 times by 1 test: status = 1 ;Executed by:
| 3 | ||||||||||||||||||||||||
| 202 | 1 executed 3 times by 1 test: status = 1 ;Executed by:
| 3 | ||||||||||||||||||||||||
| 203 | ; executed 3 times by 1 test: status = 1 ;Executed by:
| 3 | ||||||||||||||||||||||||
| 204 | else | - | ||||||||||||||||||||||||
| 205 | { | - | ||||||||||||||||||||||||
| 206 | if (((
| 3-4 | ||||||||||||||||||||||||
| 207 | puts (signame); executed 4 times by 1 test: puts (signame);Executed by:
| 4 | ||||||||||||||||||||||||
| 208 | else | - | ||||||||||||||||||||||||
| 209 | printf ("%d\n", signum); executed 3 times by 1 test: printf ("%d\n", signum);Executed by:
| 3 | ||||||||||||||||||||||||
| 210 | } | - | ||||||||||||||||||||||||
| 211 | } | - | ||||||||||||||||||||||||
| 212 | else | - | ||||||||||||||||||||||||
| 213 | for (signum = 1; signum <= (
| 1-64 | ||||||||||||||||||||||||
| 214 | 65
| 1-64 | ||||||||||||||||||||||||
| 215 | - 1)
| 1-64 | ||||||||||||||||||||||||
| 216 | if (sig2str (signum, signame) == 0
| 2-62 | ||||||||||||||||||||||||
| 217 | puts (signame); executed 62 times by 1 test: puts (signame);Executed by:
| 62 | ||||||||||||||||||||||||
| 218 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||
| 220 | return executed 10 times by 1 test: status;return status;Executed by:
executed 10 times by 1 test: return status;Executed by:
| 10 | ||||||||||||||||||||||||
| 221 | } | - | ||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | static int | - | ||||||||||||||||||||||||
| 227 | send_signals (int signum, char *const *argv) | - | ||||||||||||||||||||||||
| 228 | { | - | ||||||||||||||||||||||||
| 229 | int status = | - | ||||||||||||||||||||||||
| 230 | 0 | - | ||||||||||||||||||||||||
| 231 | ; | - | ||||||||||||||||||||||||
| 232 | char const *arg = *argv; | - | ||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||
| 234 | do | - | ||||||||||||||||||||||||
| 235 | { | - | ||||||||||||||||||||||||
| 236 | char *endp; | - | ||||||||||||||||||||||||
| 237 | intmax_t n = ( | - | ||||||||||||||||||||||||
| 238 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 239 | = 0, strtoimax (arg, &endp, 10)); | - | ||||||||||||||||||||||||
| 240 | pid_t pid = n; | - | ||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||
| 242 | if ( | - | ||||||||||||||||||||||||
| 243 | (*
| 0-8 | ||||||||||||||||||||||||
| 244 | ==
| 0-8 | ||||||||||||||||||||||||
| 245 | 34
| 0-8 | ||||||||||||||||||||||||
| 246 | || pid != n
| 0-8 | ||||||||||||||||||||||||
| 247 | { | - | ||||||||||||||||||||||||
| 248 | error (0, 0, | - | ||||||||||||||||||||||||
| 249 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 250 | "%s: invalid process id" | - | ||||||||||||||||||||||||
| 251 | , 5) | - | ||||||||||||||||||||||||
| 252 | , quote (arg)); | - | ||||||||||||||||||||||||
| 253 | status = | - | ||||||||||||||||||||||||
| 254 | 1 | - | ||||||||||||||||||||||||
| 255 | ; | - | ||||||||||||||||||||||||
| 256 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 257 | else if (kill (pid, signum) != 0
| 0-7 | ||||||||||||||||||||||||
| 258 | { | - | ||||||||||||||||||||||||
| 259 | error (0, | - | ||||||||||||||||||||||||
| 260 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 261 | , "%s", quote (arg)); | - | ||||||||||||||||||||||||
| 262 | status = | - | ||||||||||||||||||||||||
| 263 | 1 | - | ||||||||||||||||||||||||
| 264 | ; | - | ||||||||||||||||||||||||
| 265 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 266 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 267 | while ((
| 0-8 | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | return executed 8 times by 1 test: status;return status;Executed by:
executed 8 times by 1 test: return status;Executed by:
| 8 | ||||||||||||||||||||||||
| 270 | } | - | ||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | int | - | ||||||||||||||||||||||||
| 273 | main (int argc, char **argv) | - | ||||||||||||||||||||||||
| 274 | { | - | ||||||||||||||||||||||||
| 275 | int optc; | - | ||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||
| 277 | _Bool | - | ||||||||||||||||||||||||
| 278 | list = | - | ||||||||||||||||||||||||
| 279 | 0 | - | ||||||||||||||||||||||||
| 280 | ; | - | ||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | _Bool | - | ||||||||||||||||||||||||
| 283 | table = | - | ||||||||||||||||||||||||
| 284 | 0 | - | ||||||||||||||||||||||||
| 285 | ; | - | ||||||||||||||||||||||||
| 286 | int signum = -1; | - | ||||||||||||||||||||||||
| 287 | char signame[(sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1)]; | - | ||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||
| 289 | ; | - | ||||||||||||||||||||||||
| 290 | set_program_name (argv[0]); | - | ||||||||||||||||||||||||
| 291 | setlocale ( | - | ||||||||||||||||||||||||
| 292 | 6 | - | ||||||||||||||||||||||||
| 293 | , ""); | - | ||||||||||||||||||||||||
| 294 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||||||||||||||||||||
| 295 | textdomain ("coreutils"); | - | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | atexit (close_stdout); | - | ||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||
| 299 | while ((
| 19-37 | ||||||||||||||||||||||||
| 300 | ((void *)0)
| 19-37 | ||||||||||||||||||||||||
| 301 | ))
| 19-37 | ||||||||||||||||||||||||
| 302 | != -1
| 19-37 | ||||||||||||||||||||||||
| 303 | switch (optc) | - | ||||||||||||||||||||||||
| 304 | { | - | ||||||||||||||||||||||||
| 305 | case executed 3 times by 1 test: '0':case '0':Executed by:
executed 3 times by 1 test: casecase '0':Executed by:
executed 3 times by 1 test: '1':case '1':Executed by:
executed 3 times by 1 test: casecase '1':Executed by:
never executed: '2':case '2':never executed: casecase '2':never executed: '3':case '3':never executed: casecase '3':never executed: '4':case '4':never executed: case '4': | 0-3 | ||||||||||||||||||||||||
| 306 | case never executed: '5':case '5':never executed: casecase '5':never executed: '6':case '6':never executed: casecase '6':never executed: '7':case '7':never executed: casecase '7':never executed: '8':case '8':never executed: casecase '8':never executed: '9':case '9':never executed: case '9': | 0 | ||||||||||||||||||||||||
| 307 | if (optind != 2
| 3 | ||||||||||||||||||||||||
| 308 | { | - | ||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | optind--; | - | ||||||||||||||||||||||||
| 311 | goto executed 3 times by 1 test: no_more_options;goto no_more_options;Executed by:
executed 3 times by 1 test: goto no_more_options;Executed by:
| 3 | ||||||||||||||||||||||||
| 312 | } | - | ||||||||||||||||||||||||
| 313 | ((void) 0); | - | ||||||||||||||||||||||||
| 314 | case never executed: case 'A':code before this statement executed 3 times by 1 test: case 'A':Executed by:
never executed: 'A':case 'A':code before this statement executed 3 times by 1 test: case 'A':Executed by:
never executed: casecase 'A':never executed: 'B':case 'B':never executed: casecase 'B':executed 2 times by 1 test: 'C':case 'C':Executed by:
executed 2 times by 1 test: casecase 'C':Executed by:
never executed: 'D':case 'D':never executed: casecase 'D':never executed: 'E':case 'E':never executed: case 'E': | 0-3 | ||||||||||||||||||||||||
| 315 | case never executed: 'F':case 'F':never executed: casecase 'F':never executed: 'G':case 'G':never executed: casecase 'G':never executed: 'H':case 'H':never executed: casecase 'H':never executed: 'I':case 'I':never executed: casecase 'I':never executed: 'J':case 'J':never executed: case 'J': | 0 | ||||||||||||||||||||||||
| 316 | case never executed: 'K':case 'K':never executed: casecase 'K':never executed: 'M':case 'M':never executed: casecase 'M':never executed: 'N':case 'N':never executed: casecase 'N':never executed: 'O':case 'O':never executed: case 'O': | 0 | ||||||||||||||||||||||||
| 317 | case never executed: 'P':case 'P':never executed: casecase 'P':never executed: 'Q':case 'Q':never executed: casecase 'Q':never executed: 'R':case 'R':never executed: casecase 'R':never executed: 'S':case 'S':never executed: casecase 'S':executed 1 time by 1 test: 'T':case 'T':Executed by:
executed 1 time by 1 test: case 'T':Executed by:
| 0-1 | ||||||||||||||||||||||||
| 318 | case never executed: 'U':case 'U':never executed: casecase 'U':never executed: 'V':case 'V':never executed: casecase 'V':never executed: 'W':case 'W':never executed: casecase 'W':never executed: 'X':case 'X':never executed: casecase 'X':never executed: 'Y':case 'Y':never executed: case 'Y': | 0 | ||||||||||||||||||||||||
| 319 | case never executed: 'Z':case 'Z':never executed: case 'Z': | 0 | ||||||||||||||||||||||||
| 320 | if (! optarg
| 3 | ||||||||||||||||||||||||
| 321 | optarg = argv[optind - 1] + strlen (argv[optind - 1]); executed 3 times by 1 test: optarg = argv[optind - 1] + strlen (argv[optind - 1]);Executed by:
| 3 | ||||||||||||||||||||||||
| 322 | if (optarg != argv[optind - 1] + 2
| 0-6 | ||||||||||||||||||||||||
| 323 | { | - | ||||||||||||||||||||||||
| 324 | error (0, 0, | - | ||||||||||||||||||||||||
| 325 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 326 | "invalid option -- %c" | - | ||||||||||||||||||||||||
| 327 | , 5) | - | ||||||||||||||||||||||||
| 328 | , optc); | - | ||||||||||||||||||||||||
| 329 | usage ( | - | ||||||||||||||||||||||||
| 330 | 1 | - | ||||||||||||||||||||||||
| 331 | ); | - | ||||||||||||||||||||||||
| 332 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 333 | optarg--; | - | ||||||||||||||||||||||||
| 334 | ((void) 0); | - | ||||||||||||||||||||||||
| 335 | case executed 1 time by 1 test: 'n':case 'n':Executed by:
executed 1 time by 1 test: case 'n':Executed by:
code before this statement executed 6 times by 1 test: case 'n':Executed by:
| 1-6 | ||||||||||||||||||||||||
| 336 | case executed 3 times by 1 test: 's':case 's':Executed by:
executed 3 times by 1 test: case 's':Executed by:
| 3 | ||||||||||||||||||||||||
| 337 | if (0 <= signum
| 0-10 | ||||||||||||||||||||||||
| 338 | { | - | ||||||||||||||||||||||||
| 339 | error (0, 0, | - | ||||||||||||||||||||||||
| 340 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 341 | "%s: multiple signals specified" | - | ||||||||||||||||||||||||
| 342 | , 5) | - | ||||||||||||||||||||||||
| 343 | , quote (optarg)); | - | ||||||||||||||||||||||||
| 344 | usage ( | - | ||||||||||||||||||||||||
| 345 | 1 | - | ||||||||||||||||||||||||
| 346 | ); | - | ||||||||||||||||||||||||
| 347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 348 | signum = operand2sig (optarg, signame); | - | ||||||||||||||||||||||||
| 349 | if (signum < 0
| 0-10 | ||||||||||||||||||||||||
| 350 | usage ( never executed: usage ( 1 ); | 0 | ||||||||||||||||||||||||
| 351 | 1 never executed: usage ( 1 ); | 0 | ||||||||||||||||||||||||
| 352 | ); never executed: usage ( 1 ); | 0 | ||||||||||||||||||||||||
| 353 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | case executed 1 time by 1 test: 'L':case 'L':Executed by:
executed 1 time by 1 test: case 'L':Executed by:
| 1 | ||||||||||||||||||||||||
| 356 | case executed 4 times by 1 test: 't':case 't':Executed by:
executed 4 times by 1 test: case 't':Executed by:
| 4 | ||||||||||||||||||||||||
| 357 | table = | - | ||||||||||||||||||||||||
| 358 | 1 | - | ||||||||||||||||||||||||
| 359 | ; | - | ||||||||||||||||||||||||
| 360 | ((void) 0); | - | ||||||||||||||||||||||||
| 361 | case executed 11 times by 1 test: 'l':case 'l':Executed by:
executed 11 times by 1 test: case 'l':Executed by:
code before this statement executed 5 times by 1 test: case 'l':Executed by:
| 5-11 | ||||||||||||||||||||||||
| 362 | if (list
| 2-14 | ||||||||||||||||||||||||
| 363 | { | - | ||||||||||||||||||||||||
| 364 | error (0, 0, | - | ||||||||||||||||||||||||
| 365 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 366 | "multiple -l or -t options specified" | - | ||||||||||||||||||||||||
| 367 | , 5) | - | ||||||||||||||||||||||||
| 368 | ); | - | ||||||||||||||||||||||||
| 369 | usage ( | - | ||||||||||||||||||||||||
| 370 | 1 | - | ||||||||||||||||||||||||
| 371 | ); | - | ||||||||||||||||||||||||
| 372 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 373 | list = | - | ||||||||||||||||||||||||
| 374 | 1 | - | ||||||||||||||||||||||||
| 375 | ; | - | ||||||||||||||||||||||||
| 376 | break; executed 14 times by 1 test: break;Executed by:
| 14 | ||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||
| 378 | case executed 2 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 2 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 2 | ||||||||||||||||||||||||
| 379 | 0 | - | ||||||||||||||||||||||||
| 380 | ); break; never executed: ;break; | 0 | ||||||||||||||||||||||||
| 381 | 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 | ||||||||||||||||||||||||
| 382 | stdout | - | ||||||||||||||||||||||||
| 383 | , "kill", "GNU coreutils", Version, ("Paul Eggert"), (char *) | - | ||||||||||||||||||||||||
| 384 | ((void *)0) | - | ||||||||||||||||||||||||
| 385 | ); exit ( executed 4 times by 1 test: exit ( 0 );Executed by:
| 4 | ||||||||||||||||||||||||
| 386 | 0 executed 4 times by 1 test: exit ( 0 );Executed by:
| 4 | ||||||||||||||||||||||||
| 387 | ); executed 4 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-4 | ||||||||||||||||||||||||
| 388 | default executed 2 times by 1 test: :default:Executed by:
executed 2 times by 1 test: default:Executed by:
| 2 | ||||||||||||||||||||||||
| 389 | usage ( | - | ||||||||||||||||||||||||
| 390 | 1 | - | ||||||||||||||||||||||||
| 391 | ); | - | ||||||||||||||||||||||||
| 392 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 393 | no_more_options: code before this statement executed 19 times by 1 test: no_more_options:Executed by:
| 19 | ||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||
| 395 | if (signum < 0
| 10-12 | ||||||||||||||||||||||||
| 396 | signum = executed 12 times by 1 test: signum = 15 ;Executed by:
| 12 | ||||||||||||||||||||||||
| 397 | 15 executed 12 times by 1 test: signum = 15 ;Executed by:
| 12 | ||||||||||||||||||||||||
| 398 | ; executed 12 times by 1 test: signum = 15 ;Executed by:
| 12 | ||||||||||||||||||||||||
| 399 | else if (list
| 2-8 | ||||||||||||||||||||||||
| 400 | { | - | ||||||||||||||||||||||||
| 401 | error (0, 0, | - | ||||||||||||||||||||||||
| 402 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 403 | "cannot combine signal with -l or -t" | - | ||||||||||||||||||||||||
| 404 | , 5) | - | ||||||||||||||||||||||||
| 405 | ); | - | ||||||||||||||||||||||||
| 406 | usage ( | - | ||||||||||||||||||||||||
| 407 | 1 | - | ||||||||||||||||||||||||
| 408 | ); | - | ||||||||||||||||||||||||
| 409 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||
| 411 | if ( ! list
| 2-10 | ||||||||||||||||||||||||
| 412 | { | - | ||||||||||||||||||||||||
| 413 | error (0, 0, | - | ||||||||||||||||||||||||
| 414 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 415 | "no process ID specified" | - | ||||||||||||||||||||||||
| 416 | , 5) | - | ||||||||||||||||||||||||
| 417 | ); | - | ||||||||||||||||||||||||
| 418 | usage ( | - | ||||||||||||||||||||||||
| 419 | 1 | - | ||||||||||||||||||||||||
| 420 | ); | - | ||||||||||||||||||||||||
| 421 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||
| 423 | return executed 18 times by 1 test: (listreturn (list ? list_signals (table, optind < argc ? argv + optind : ((void *)0) ) : send_signals (signum, argv + optind));Executed by:
executed 18 times by 1 test: return (list ? list_signals (table, optind < argc ? argv + optind : ((void *)0) ) : send_signals (signum, argv + optind));Executed by:
| 18 | ||||||||||||||||||||||||
| 424 | ? list_signals (table, optind < argc ? argv + optind : executed 18 times by 1 test: return (list ? list_signals (table, optind < argc ? argv + optind : ((void *)0) ) : send_signals (signum, argv + optind));Executed by:
| 18 | ||||||||||||||||||||||||
| 425 | ((void *)0) executed 18 times by 1 test: return (list ? list_signals (table, optind < argc ? argv + optind : ((void *)0) ) : send_signals (signum, argv + optind));Executed by:
| 18 | ||||||||||||||||||||||||
| 426 | ) executed 18 times by 1 test: return (list ? list_signals (table, optind < argc ? argv + optind : ((void *)0) ) : send_signals (signum, argv + optind));Executed by:
| 18 | ||||||||||||||||||||||||
| 427 | : send_signals (signum, argv + optind)); executed 18 times by 1 test: return (list ? list_signals (table, optind < argc ? argv + optind : ((void *)0) ) : send_signals (signum, argv + optind));Executed by:
| 18 | ||||||||||||||||||||||||
| 428 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |