summaryrefslogtreecommitdiff
path: root/upb/upb.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2012-03-31 12:17:32 -0700
committerJoshua Haberman <jhaberman@gmail.com>2012-03-31 12:17:32 -0700
commitcca4818eb7769d6e776bdc30516a5f871f1d6393 (patch)
treee67dd65d5c016028ae976b09b2d69f6b7525aa5f /upb/upb.c
parent26ed1e996171c8ffa2ced42ac69b1b82c1956e1f (diff)
Sync from internal Google development.
Diffstat (limited to 'upb/upb.c')
-rw-r--r--upb/upb.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/upb/upb.c b/upb/upb.c
index c172bd3..5a00961 100644
--- a/upb/upb.c
+++ b/upb/upb.c
@@ -91,40 +91,6 @@ void upb_status_setcode(upb_status *status, upb_errorspace *space, int code) {
status->str = NULL;
}
-void upb_status_fromerrno(upb_status *status) {
- if (errno != 0 && !upb_errno_is_wouldblock()) {
- status->error = true;
- upb_status_setcode(status, &upb_posix_errorspace, errno);
- }
-}
-
-bool upb_errno_is_wouldblock() {
- return
-#ifdef EAGAIN
- errno == EAGAIN ||
-#endif
-#ifdef EWOULDBLOCK
- errno == EWOULDBLOCK ||
-#endif
- false;
-}
-
-bool upb_posix_codetostr(int code, char *buf, size_t len) {
- if (strerror_r(code, buf, len) == -1) {
- if (errno == EINVAL) {
- size_t actual_len =
- snprintf(buf, len, "Invalid POSIX error number %d\n", code);
- return actual_len >= len;
- } else if (errno == ERANGE) {
- return false;
- }
- assert(false);
- }
- return true;
-}
-
-upb_errorspace upb_posix_errorspace = {"POSIX", &upb_posix_codetostr};
-
int upb_vrprintf(char **buf, size_t *size, size_t ofs,
const char *fmt, va_list args) {
// Try once without reallocating. We have to va_copy because we might have
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback