Open Source Telephony
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: ofono@ofono.org
Subject: [PATCH] mbim: add an optional TEMP_FAILURE_RETRY macro copy
Date: Thu, 23 May 2019 18:20:30 -0700	[thread overview]
Message-ID: <20190524012030.28913-1-raj.khem@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

Fixes build on musl which does not provide this macro

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 drivers/mbimmodem/mbim-private.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mbimmodem/mbim-private.h b/drivers/mbimmodem/mbim-private.h
index e159235..51693ea 100644
--- a/drivers/mbimmodem/mbim-private.h
+++ b/drivers/mbimmodem/mbim-private.h
@@ -21,6 +21,15 @@
 
 #define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1))
 
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) ({     \
+  __typeof(expression) __result;              \
+  do {                                        \
+    __result = (expression);                  \
+  } while (__result == -1 && errno == EINTR); \
+  __result; })
+#endif
+
 enum mbim_control_message {
 	MBIM_OPEN_MSG = 0x1,
 	MBIM_CLOSE_MSG = 0x2,
-- 
2.21.0


             reply	other threads:[~2019-05-24  1:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24  1:20 Khem Raj [this message]
2019-05-24 16:57 ` [PATCH] mbim: add an optional TEMP_FAILURE_RETRY macro copy Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524012030.28913-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox