diff options
author | Matt Kraai | 2000-12-15 22:34:34 +0000 |
---|---|---|
committer | Matt Kraai | 2000-12-15 22:34:34 +0000 |
commit | bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b (patch) | |
tree | 8269fa410bbc0b34bcd732c08054dca087b07ba3 /utility.c | |
parent | 8677d7b6ec95cc9fa5c98b077680fc7ed4254d40 (diff) | |
download | busybox-bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b.zip busybox-bfa7967c4a18c9a7addbe853cf9f736ac34b4e5b.tar.gz |
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) } #endif /* BB_TAR || BB_AR */ -#if defined BB_TAR || defined BB_CP_MV || defined BB_AR || defined BB_DD +#if defined BB_AR || defined BB_CP_MV || defined BB_DD || defined BB_NC || defined BB_TAR /* * Write all of the supplied buffer out to a file. * This does multiple writes as necessary. @@ -1791,6 +1791,19 @@ int applet_name_compare(const void *x, const void *y) return strcmp(applet1->name, applet2->name); } +#if defined BB_NC +ssize_t safe_read(int fd, void *buf, size_t count) +{ + ssize_t n; + + do { + n = read(fd, buf, count); + } while (n < 0 && errno == EINTR); + + return n; +} +#endif + /* END CODE */ /* Local Variables: |