summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 02479d9..4654dae 100644
--- a/utility.c
+++ b/utility.c
@@ -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: