Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (6 years ago)
Author:
bruno
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

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

    r2725 r3232  
    2626
    2727/* Turn on nonblocking I/O on a fd */
    28 int FAST_FUNC ndelay_on(int fd)
    29 {
    30     return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
    31 }
    32 
    33 int FAST_FUNC ndelay_off(int fd)
    34 {
    35     return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK);
    36 }
    37 
    38 int FAST_FUNC close_on_exec_on(int fd)
    39 {
    40     return fcntl(fd, F_SETFD, FD_CLOEXEC);
     28void FAST_FUNC ndelay_on(int fd)
     29{
     30    int flags = fcntl(fd, F_GETFL);
     31    if (flags & O_NONBLOCK)
     32        return;
     33    fcntl(fd, F_SETFL, flags | O_NONBLOCK);
     34}
     35
     36void FAST_FUNC ndelay_off(int fd)
     37{
     38    int flags = fcntl(fd, F_GETFL);
     39    if (!(flags & O_NONBLOCK))
     40        return;
     41    fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
     42}
     43
     44void FAST_FUNC close_on_exec_on(int fd)
     45{
     46    fcntl(fd, F_SETFD, FD_CLOEXEC);
    4147}
    4248
     
    235241        if (s) {
    236242            value = atoi(s);
    237             /* If LINES/COLUMNS are set, pretent that there is
     243            /* If LINES/COLUMNS are set, pretend that there is
    238244             * no error getting w/h, this prevents some ugly
    239245             * cursor tricks by our callers */
Note: See TracChangeset for help on using the changeset viewer.