Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/xfuncs.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/libbb/xfuncs.c

    r3232 r3621  
    2626
    2727/* Turn on nonblocking I/O on a fd */
    28 void FAST_FUNC ndelay_on(int fd)
     28int FAST_FUNC ndelay_on(int fd)
    2929{
    3030    int flags = fcntl(fd, F_GETFL);
    3131    if (flags & O_NONBLOCK)
    32         return;
     32        return flags;
    3333    fcntl(fd, F_SETFL, flags | O_NONBLOCK);
    34 }
    35 
    36 void FAST_FUNC ndelay_off(int fd)
     34    return flags;
     35}
     36
     37int FAST_FUNC ndelay_off(int fd)
    3738{
    3839    int flags = fcntl(fd, F_GETFL);
    3940    if (!(flags & O_NONBLOCK))
    40         return;
     41        return flags;
    4142    fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
     43    return flags;
    4244}
    4345
     
    206208
    207209        // If we can't, it's smaller.
    208 
    209210        } else {
    210211            if (bottom == top) {
     
    270271    return err;
    271272}
     273int FAST_FUNC get_terminal_width(int fd)
     274{
     275    unsigned width;
     276    get_terminal_width_height(fd, &width, NULL);
     277    return width;
     278}
    272279
    273280int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp)
     
    309316    return 0;
    310317}
     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.
     321int 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.