diff options
author | Matt Kraai <kraai@debian.org> | 2000-12-15 22:34:34 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-12-15 22:34:34 +0000 |
commit | bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b (patch) | |
tree | 8269fa410bbc0b34bcd732c08054dca087b07ba3 /utility.c | |
parent | 8677d7b6ec95cc9fa5c98b077680fc7ed4254d40 (diff) | |
download | busybox-w32-bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b.tar.gz busybox-w32-bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b.tar.bz2 busybox-w32-bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b.zip |
Rewrite nc to be simpler, smaller, and to check syscalls for errors.
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -536,7 +536,7 @@ const char *time_string(time_t timeVal) | |||
536 | } | 536 | } |
537 | #endif /* BB_TAR || BB_AR */ | 537 | #endif /* BB_TAR || BB_AR */ |
538 | 538 | ||
539 | #if defined BB_TAR || defined BB_CP_MV || defined BB_AR || defined BB_DD | 539 | #if defined BB_AR || defined BB_CP_MV || defined BB_DD || defined BB_NC || defined BB_TAR |
540 | /* | 540 | /* |
541 | * Write all of the supplied buffer out to a file. | 541 | * Write all of the supplied buffer out to a file. |
542 | * This does multiple writes as necessary. | 542 | * This does multiple writes as necessary. |
@@ -1791,6 +1791,19 @@ int applet_name_compare(const void *x, const void *y) | |||
1791 | return strcmp(applet1->name, applet2->name); | 1791 | return strcmp(applet1->name, applet2->name); |
1792 | } | 1792 | } |
1793 | 1793 | ||
1794 | #if defined BB_NC | ||
1795 | ssize_t safe_read(int fd, void *buf, size_t count) | ||
1796 | { | ||
1797 | ssize_t n; | ||
1798 | |||
1799 | do { | ||
1800 | n = read(fd, buf, count); | ||
1801 | } while (n < 0 && errno == EINTR); | ||
1802 | |||
1803 | return n; | ||
1804 | } | ||
1805 | #endif | ||
1806 | |||
1794 | /* END CODE */ | 1807 | /* END CODE */ |
1795 | /* | 1808 | /* |
1796 | Local Variables: | 1809 | Local Variables: |