Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/xfuncs.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/libbb/xfuncs.c
r2725 r3232 26 26 27 27 /* 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); 28 void 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 36 void 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 44 void FAST_FUNC close_on_exec_on(int fd) 45 { 46 fcntl(fd, F_SETFD, FD_CLOEXEC); 41 47 } 42 48 … … 235 241 if (s) { 236 242 value = atoi(s); 237 /* If LINES/COLUMNS are set, preten tthat there is243 /* If LINES/COLUMNS are set, pretend that there is 238 244 * no error getting w/h, this prevents some ugly 239 245 * cursor tricks by our callers */
Note:
See TracChangeset
for help on using the changeset viewer.