summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-28 18:23:38 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-28 19:07:12 -0500
commit87b0284327e34a4b96c22085fa2cdb3219294991 (patch)
tree3dfa856eb4ee93e6e7808f442a7dd14daff00d8e /src/shared
parent7b36bf82c4deeadef6d914cef750b4a51ff2ed48 (diff)
Get rid of write_safe
Current glibc implementation is safe. Kernel does this atomically, and write is actually implemented through writev. So if write is async-signal-safe, than writev pretty much must be too.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 2b91ef8a8f..30512d1646 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -6093,24 +6093,6 @@ int getpeersec(int fd, char **ret) {
return 0;
}
-int writev_safe(int fd, const struct iovec *w, int j) {
- for (int i = 0; i < j; i++) {
- size_t written = 0;
-
- while (written < w[i].iov_len) {
- ssize_t r;
-
- r = write(fd, (char*) w[i].iov_base + written, w[i].iov_len - written);
- if (r < 0 && errno != -EINTR)
- return -errno;
-
- written += r;
- }
- }
-
- return 0;
-}
-
int mkostemp_safe(char *pattern, int flags) {
unsigned long tries = TMP_MAX;
char *s;