| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssh/src/openbsd-compat/readpassphrase.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | static volatile sig_atomic_t signo[ | - | ||||||||||||||||||||||||
| 8 | 65 | - | ||||||||||||||||||||||||
| 9 | ]; | - | ||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | static void handler(int); | - | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | char * | - | ||||||||||||||||||||||||
| 14 | readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) | - | ||||||||||||||||||||||||
| 15 | { | - | ||||||||||||||||||||||||
| 16 | ssize_t nr; | - | ||||||||||||||||||||||||
| 17 | int input, output, save_errno, i, need_restart; | - | ||||||||||||||||||||||||
| 18 | char ch, *p, *end; | - | ||||||||||||||||||||||||
| 19 | struct termios term, oterm; | - | ||||||||||||||||||||||||
| 20 | struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; | - | ||||||||||||||||||||||||
| 21 | struct sigaction savetstp, savettin, savettou, savepipe; | - | ||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | if (bufsiz == 0
| 0 | ||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 27 | = | - | ||||||||||||||||||||||||
| 28 | 22 | - | ||||||||||||||||||||||||
| 29 | ; | - | ||||||||||||||||||||||||
| 30 | return never executed: (return( ((void *)0) );never executed: return( ((void *)0) ); | 0 | ||||||||||||||||||||||||
| 31 | ((void *)0) never executed: return( ((void *)0) ); | 0 | ||||||||||||||||||||||||
| 32 | ); never executed: return( ((void *)0) ); | 0 | ||||||||||||||||||||||||
| 33 | } | - | ||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||
| 35 | restart: code before this statement never executed: restart: | 0 | ||||||||||||||||||||||||
| 36 | for (i = 0; i <
| 0 | ||||||||||||||||||||||||
| 37 | 65
| 0 | ||||||||||||||||||||||||
| 38 | ; i++) | - | ||||||||||||||||||||||||
| 39 | signo[i] = 0; never executed: signo[i] = 0; | 0 | ||||||||||||||||||||||||
| 40 | nr = -1; | - | ||||||||||||||||||||||||
| 41 | save_errno = 0; | - | ||||||||||||||||||||||||
| 42 | need_restart = 0; | - | ||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||
| 47 | if ((
| 0 | ||||||||||||||||||||||||
| 48 | (
| 0 | ||||||||||||||||||||||||
| 49 | "/dev/tty"
| 0 | ||||||||||||||||||||||||
| 50 | ,
| 0 | ||||||||||||||||||||||||
| 51 | 02
| 0 | ||||||||||||||||||||||||
| 52 | )) == -1
| 0 | ||||||||||||||||||||||||
| 53 | if (flags & 0x02
| 0 | ||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||
| 55 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 56 | = | - | ||||||||||||||||||||||||
| 57 | 25 | - | ||||||||||||||||||||||||
| 58 | ; | - | ||||||||||||||||||||||||
| 59 | return never executed: (return( ((void *)0) );never executed: return( ((void *)0) ); | 0 | ||||||||||||||||||||||||
| 60 | ((void *)0) never executed: return( ((void *)0) ); | 0 | ||||||||||||||||||||||||
| 61 | ); never executed: return( ((void *)0) ); | 0 | ||||||||||||||||||||||||
| 62 | } | - | ||||||||||||||||||||||||
| 63 | input = | - | ||||||||||||||||||||||||
| 64 | 0 | - | ||||||||||||||||||||||||
| 65 | ; | - | ||||||||||||||||||||||||
| 66 | output = | - | ||||||||||||||||||||||||
| 67 | 2 | - | ||||||||||||||||||||||||
| 68 | ; | - | ||||||||||||||||||||||||
| 69 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | if (input !=
| 0 | ||||||||||||||||||||||||
| 77 | 0
| 0 | ||||||||||||||||||||||||
| 78 | && tcgetattr(input, &oterm) == 0
| 0 | ||||||||||||||||||||||||
| 79 | memcpy(&term, &oterm, sizeof(term)); | - | ||||||||||||||||||||||||
| 80 | if (!(flags & 0x01)
| 0 | ||||||||||||||||||||||||
| 81 | term.c_lflag &= ~( never executed: term.c_lflag &= ~( 0000010 | 0000100 ); | 0 | ||||||||||||||||||||||||
| 82 | 0000010 never executed: term.c_lflag &= ~( 0000010 | 0000100 ); | 0 | ||||||||||||||||||||||||
| 83 | | never executed: term.c_lflag &= ~( 0000010 | 0000100 ); | 0 | ||||||||||||||||||||||||
| 84 | 0000100 never executed: term.c_lflag &= ~( 0000010 | 0000100 ); | 0 | ||||||||||||||||||||||||
| 85 | ); never executed: term.c_lflag &= ~( 0000010 | 0000100 ); | 0 | ||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | (void)tcsetattr(input, | - | ||||||||||||||||||||||||
| 91 | 2 | - | ||||||||||||||||||||||||
| 92 | |0, &term); | - | ||||||||||||||||||||||||
| 93 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 94 | memset(&term, 0, sizeof(term)); | - | ||||||||||||||||||||||||
| 95 | term.c_lflag |= | - | ||||||||||||||||||||||||
| 96 | 0000010 | - | ||||||||||||||||||||||||
| 97 | ; | - | ||||||||||||||||||||||||
| 98 | memset(&oterm, 0, sizeof(oterm)); | - | ||||||||||||||||||||||||
| 99 | oterm.c_lflag |= | - | ||||||||||||||||||||||||
| 100 | 0000010 | - | ||||||||||||||||||||||||
| 101 | ; | - | ||||||||||||||||||||||||
| 102 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||
| 109 | sigemptyset(&sa.sa_mask); | - | ||||||||||||||||||||||||
| 110 | sa.sa_flags = 0; | - | ||||||||||||||||||||||||
| 111 | sa. | - | ||||||||||||||||||||||||
| 112 | __sigaction_handler.sa_handler | - | ||||||||||||||||||||||||
| 113 | = handler; | - | ||||||||||||||||||||||||
| 114 | (void)sigaction( | - | ||||||||||||||||||||||||
| 115 | 14 | - | ||||||||||||||||||||||||
| 116 | , &sa, &savealrm); | - | ||||||||||||||||||||||||
| 117 | (void)sigaction( | - | ||||||||||||||||||||||||
| 118 | 1 | - | ||||||||||||||||||||||||
| 119 | , &sa, &savehup); | - | ||||||||||||||||||||||||
| 120 | (void)sigaction( | - | ||||||||||||||||||||||||
| 121 | 2 | - | ||||||||||||||||||||||||
| 122 | , &sa, &saveint); | - | ||||||||||||||||||||||||
| 123 | (void)sigaction( | - | ||||||||||||||||||||||||
| 124 | 13 | - | ||||||||||||||||||||||||
| 125 | , &sa, &savepipe); | - | ||||||||||||||||||||||||
| 126 | (void)sigaction( | - | ||||||||||||||||||||||||
| 127 | 3 | - | ||||||||||||||||||||||||
| 128 | , &sa, &savequit); | - | ||||||||||||||||||||||||
| 129 | (void)sigaction( | - | ||||||||||||||||||||||||
| 130 | 15 | - | ||||||||||||||||||||||||
| 131 | , &sa, &saveterm); | - | ||||||||||||||||||||||||
| 132 | (void)sigaction( | - | ||||||||||||||||||||||||
| 133 | 20 | - | ||||||||||||||||||||||||
| 134 | , &sa, &savetstp); | - | ||||||||||||||||||||||||
| 135 | (void)sigaction( | - | ||||||||||||||||||||||||
| 136 | 21 | - | ||||||||||||||||||||||||
| 137 | , &sa, &savettin); | - | ||||||||||||||||||||||||
| 138 | (void)sigaction( | - | ||||||||||||||||||||||||
| 139 | 22 | - | ||||||||||||||||||||||||
| 140 | , &sa, &savettou); | - | ||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | if (!(flags & 0x20)
| 0 | ||||||||||||||||||||||||
| 143 | ( never executed: void)write(output, prompt, strlen(prompt));(void)write(output, prompt, strlen(prompt));never executed: (void)write(output, prompt, strlen(prompt)); | 0 | ||||||||||||||||||||||||
| 144 | end = buf + bufsiz - 1; | - | ||||||||||||||||||||||||
| 145 | p = buf; | - | ||||||||||||||||||||||||
| 146 | while ((
| 0 | ||||||||||||||||||||||||
| 147 | if (p < end
| 0 | ||||||||||||||||||||||||
| 148 | if ((
| 0 | ||||||||||||||||||||||||
| 149 | ch &= 0x7f; never executed: ch &= 0x7f; | 0 | ||||||||||||||||||||||||
| 150 | if ( | - | ||||||||||||||||||||||||
| 151 | ((*
| 0 | ||||||||||||||||||||||||
| 152 | (unsigned char)ch
| 0 | ||||||||||||||||||||||||
| 153 | ))] & (unsigned short int) _ISalpha)
| 0 | ||||||||||||||||||||||||
| 154 | ) { | - | ||||||||||||||||||||||||
| 155 | if ((
| 0 | ||||||||||||||||||||||||
| 156 | ch = (char) never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 157 | (__extension__ ({ int __res; if (sizeof (
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 158 | (unsigned char)ch
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 159 | ) > 1
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 160 | (unsigned char)ch
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 161 | )
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 162 | (unsigned char)ch never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 163 | ); __res = __c < -128
never executed: else __res = tolower (end of blocknever executed: __res = tolower ( (unsigned char)ch );never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 164 | (unsigned char)ch never executed: __res = tolower ( (unsigned char)ch );never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 165 | ); never executed: } else __res = (*__ctype_tolower_loc ())[(int) (__res = tolower ( (unsigned char)ch );never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )];never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 166 | (unsigned char)ch never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )];never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 167 | )]; never executed: __res; }))__res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )];never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 168 | ; never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower ( (unsigned char)ch ); } else __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 169 | if ((
| 0 | ||||||||||||||||||||||||
| 170 | ch = (char) never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 171 | (__extension__ ({ int __res; if (sizeof (
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 172 | (unsigned char)ch
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 173 | ) > 1
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 174 | (unsigned char)ch
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 175 | )
never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 176 | (unsigned char)ch never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 177 | ); __res = __c < -128
never executed: else __res = toupper (end of blocknever executed: __res = toupper ( (unsigned char)ch );never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 178 | (unsigned char)ch never executed: __res = toupper ( (unsigned char)ch );never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 179 | ); never executed: } else __res = (*__ctype_toupper_loc ())[(int) (__res = toupper ( (unsigned char)ch );never executed: __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )];never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 180 | (unsigned char)ch never executed: __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )];never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 181 | )]; never executed: __res; }))__res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )];never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 182 | ; never executed: ch = (char) (__extension__ ({ int __res; if (sizeof ( (unsigned char)ch ) > 1) { if (__builtin_constant_p ( (unsigned char)ch )) { int __c = ( (unsigned char)ch ); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper ( (unsigned char)ch ); } else __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char)ch )]; __res; })) ; | 0 | ||||||||||||||||||||||||
| 183 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 184 | *p++ = ch; | - | ||||||||||||||||||||||||
| 185 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 186 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 187 | *p = '\0'; | - | ||||||||||||||||||||||||
| 188 | save_errno = | - | ||||||||||||||||||||||||
| 189 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 190 | ; | - | ||||||||||||||||||||||||
| 191 | if (!(term.c_lflag &
| 0 | ||||||||||||||||||||||||
| 192 | 0000010
| 0 | ||||||||||||||||||||||||
| 193 | )
| 0 | ||||||||||||||||||||||||
| 194 | ( never executed: void)write(output, "\n", 1);(void)write(output, "\n", 1);never executed: (void)write(output, "\n", 1); | 0 | ||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||
| 196 | - | |||||||||||||||||||||||||
| 197 | if (memcmp(&term, &oterm, sizeof(term)) != 0
| 0 | ||||||||||||||||||||||||
| 198 | const int sigttou = signo[ | - | ||||||||||||||||||||||||
| 199 | 22 | - | ||||||||||||||||||||||||
| 200 | ]; | - | ||||||||||||||||||||||||
| 201 | - | |||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 | while (tcsetattr(input,
| 0 | ||||||||||||||||||||||||
| 204 | 2
| 0 | ||||||||||||||||||||||||
| 205 | |0, &oterm) == -1
| 0 | ||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||
| 207 | (*
| 0 | ||||||||||||||||||||||||
| 208 | ==
| 0 | ||||||||||||||||||||||||
| 209 | 4
| 0 | ||||||||||||||||||||||||
| 210 | && !signo[
| 0 | ||||||||||||||||||||||||
| 211 | 22
| 0 | ||||||||||||||||||||||||
| 212 | ]
| 0 | ||||||||||||||||||||||||
| 213 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 214 | signo[ | - | ||||||||||||||||||||||||
| 215 | 22 | - | ||||||||||||||||||||||||
| 216 | ] = sigttou; | - | ||||||||||||||||||||||||
| 217 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 218 | (void)sigaction( | - | ||||||||||||||||||||||||
| 219 | 14 | - | ||||||||||||||||||||||||
| 220 | , &savealrm, | - | ||||||||||||||||||||||||
| 221 | ((void *)0) | - | ||||||||||||||||||||||||
| 222 | ); | - | ||||||||||||||||||||||||
| 223 | (void)sigaction( | - | ||||||||||||||||||||||||
| 224 | 1 | - | ||||||||||||||||||||||||
| 225 | , &savehup, | - | ||||||||||||||||||||||||
| 226 | ((void *)0) | - | ||||||||||||||||||||||||
| 227 | ); | - | ||||||||||||||||||||||||
| 228 | (void)sigaction( | - | ||||||||||||||||||||||||
| 229 | 2 | - | ||||||||||||||||||||||||
| 230 | , &saveint, | - | ||||||||||||||||||||||||
| 231 | ((void *)0) | - | ||||||||||||||||||||||||
| 232 | ); | - | ||||||||||||||||||||||||
| 233 | (void)sigaction( | - | ||||||||||||||||||||||||
| 234 | 3 | - | ||||||||||||||||||||||||
| 235 | , &savequit, | - | ||||||||||||||||||||||||
| 236 | ((void *)0) | - | ||||||||||||||||||||||||
| 237 | ); | - | ||||||||||||||||||||||||
| 238 | (void)sigaction( | - | ||||||||||||||||||||||||
| 239 | 13 | - | ||||||||||||||||||||||||
| 240 | , &savepipe, | - | ||||||||||||||||||||||||
| 241 | ((void *)0) | - | ||||||||||||||||||||||||
| 242 | ); | - | ||||||||||||||||||||||||
| 243 | (void)sigaction( | - | ||||||||||||||||||||||||
| 244 | 15 | - | ||||||||||||||||||||||||
| 245 | , &saveterm, | - | ||||||||||||||||||||||||
| 246 | ((void *)0) | - | ||||||||||||||||||||||||
| 247 | ); | - | ||||||||||||||||||||||||
| 248 | (void)sigaction( | - | ||||||||||||||||||||||||
| 249 | 20 | - | ||||||||||||||||||||||||
| 250 | , &savetstp, | - | ||||||||||||||||||||||||
| 251 | ((void *)0) | - | ||||||||||||||||||||||||
| 252 | ); | - | ||||||||||||||||||||||||
| 253 | (void)sigaction( | - | ||||||||||||||||||||||||
| 254 | 21 | - | ||||||||||||||||||||||||
| 255 | , &savettin, | - | ||||||||||||||||||||||||
| 256 | ((void *)0) | - | ||||||||||||||||||||||||
| 257 | ); | - | ||||||||||||||||||||||||
| 258 | (void)sigaction( | - | ||||||||||||||||||||||||
| 259 | 22 | - | ||||||||||||||||||||||||
| 260 | , &savettou, | - | ||||||||||||||||||||||||
| 261 | ((void *)0) | - | ||||||||||||||||||||||||
| 262 | ); | - | ||||||||||||||||||||||||
| 263 | if (input !=
| 0 | ||||||||||||||||||||||||
| 264 | 0
| 0 | ||||||||||||||||||||||||
| 265 | ) | - | ||||||||||||||||||||||||
| 266 | ( never executed: void)close(input);(void)close(input);never executed: (void)close(input); | 0 | ||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | for (i = 0; i <
| 0 | ||||||||||||||||||||||||
| 273 | 65
| 0 | ||||||||||||||||||||||||
| 274 | ; i++) { | - | ||||||||||||||||||||||||
| 275 | if (signo[i]
| 0 | ||||||||||||||||||||||||
| 276 | kill(getpid(), i); | - | ||||||||||||||||||||||||
| 277 | switch (i) { | - | ||||||||||||||||||||||||
| 278 | case never executed: case 20 :never executed: case 20 : | 0 | ||||||||||||||||||||||||
| 279 | 20 never executed: case 20 : | 0 | ||||||||||||||||||||||||
| 280 | : never executed: case 20 : | 0 | ||||||||||||||||||||||||
| 281 | case never executed: case 21 :never executed: case 21 : | 0 | ||||||||||||||||||||||||
| 282 | 21 never executed: case 21 : | 0 | ||||||||||||||||||||||||
| 283 | : never executed: case 21 : | 0 | ||||||||||||||||||||||||
| 284 | case never executed: case 22 :never executed: case 22 : | 0 | ||||||||||||||||||||||||
| 285 | 22 never executed: case 22 : | 0 | ||||||||||||||||||||||||
| 286 | : never executed: case 22 : | 0 | ||||||||||||||||||||||||
| 287 | need_restart = 1; | - | ||||||||||||||||||||||||
| 288 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 289 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 290 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 291 | if (need_restart
| 0 | ||||||||||||||||||||||||
| 292 | goto never executed: restart;goto restart;never executed: goto restart; | 0 | ||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||
| 294 | if (save_errno
| 0 | ||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||
| 296 | (* never executed: __errno_location ()) (*__errno_location ()) = save_errno;never executed: (*__errno_location ()) = save_errno; | 0 | ||||||||||||||||||||||||
| 297 | = save_errno; never executed: (*__errno_location ()) = save_errno; | 0 | ||||||||||||||||||||||||
| 298 | return never executed: (nr == -1return(nr == -1 ? ((void *)0) : buf);
never executed: return(nr == -1 ? ((void *)0) : buf); | 0 | ||||||||||||||||||||||||
| 299 | ((void *)0) never executed: return(nr == -1 ? ((void *)0) : buf); | 0 | ||||||||||||||||||||||||
| 300 | : buf); never executed: return(nr == -1 ? ((void *)0) : buf); | 0 | ||||||||||||||||||||||||
| 301 | } | - | ||||||||||||||||||||||||
| 302 | ; | - | ||||||||||||||||||||||||
| 303 | static void handler(int s) | - | ||||||||||||||||||||||||
| 304 | { | - | ||||||||||||||||||||||||
| 305 | - | |||||||||||||||||||||||||
| 306 | signo[s] = 1; | - | ||||||||||||||||||||||||
| 307 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |