Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/xfuncs.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/libbb/xfuncs.c
r3232 r3621 26 26 27 27 /* Turn on nonblocking I/O on a fd */ 28 voidFAST_FUNC ndelay_on(int fd)28 int FAST_FUNC ndelay_on(int fd) 29 29 { 30 30 int flags = fcntl(fd, F_GETFL); 31 31 if (flags & O_NONBLOCK) 32 return ;32 return flags; 33 33 fcntl(fd, F_SETFL, flags | O_NONBLOCK); 34 } 35 36 void FAST_FUNC ndelay_off(int fd) 34 return flags; 35 } 36 37 int FAST_FUNC ndelay_off(int fd) 37 38 { 38 39 int flags = fcntl(fd, F_GETFL); 39 40 if (!(flags & O_NONBLOCK)) 40 return ;41 return flags; 41 42 fcntl(fd, F_SETFL, flags & ~O_NONBLOCK); 43 return flags; 42 44 } 43 45 … … 206 208 207 209 // If we can't, it's smaller. 208 209 210 } else { 210 211 if (bottom == top) { … … 270 271 return err; 271 272 } 273 int FAST_FUNC get_terminal_width(int fd) 274 { 275 unsigned width; 276 get_terminal_width_height(fd, &width, NULL); 277 return width; 278 } 272 279 273 280 int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp) … … 309 316 return 0; 310 317 } 318 319 // Useful when we do know that pid is valid, and we just want to wait 320 // for it to exit. Not existing pid is fatal. waitpid() status is not returned. 321 int FAST_FUNC wait_for_exitstatus(pid_t pid) 322 { 323 int exit_status, n; 324 325 n = safe_waitpid(pid, &exit_status, 0); 326 if (n < 0) 327 bb_perror_msg_and_die("waitpid"); 328 return exit_status; 329 }
Note:
See TracChangeset
for help on using the changeset viewer.