net/tls: indicate the platform specific patch
authorJunyeon LEE <junyeon2.lee@samsung.com>
Wed, 12 Apr 2017 09:01:34 +0000 (18:01 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 18 Apr 2017 03:02:17 +0000 (12:02 +0900)
This commit indicates the TIZENRT specific patch and fixes
minor bug in net.c

Change-Id: I2c8c2f44195077137118b87a40bccb43e2e838cd
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
os/include/tls/config.h
os/net/tls/net.c

index c325105..8af20df 100644 (file)
 //#define MBEDTLS_SSL_COOKIE_TIMEOUT        60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
 
 /**
+ * \def MBED_TIZENRT
+ *
+ * Indicate the platform specific patches.
+ */
+#ifndef MBED_TIZENRT
+#define MBED_TIZENRT
+#endif
+
+/**
  * \def MBEDTLS_LIGHT_DEVICE
  *
  * Configuration for light devices.
 
 #endif                                                 /* MBEDTLS_LIGHT_DEVICE */
 
+
 //#undef MBEDTLS_ECDSA_DETERMINISTIC
 //#undef MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
 //#undef MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
index ddb5333..855f3bd 100644 (file)
@@ -278,7 +278,7 @@ static int net_would_block(const mbedtls_net_context *ctx)
        /*
         * Never return 'WOULD BLOCK' on a non-blocking socket
         */
-#ifdef CONFIG_OS_TINYARA
+#if defined(MBED_TIZENRT)
        /*
         * Because fcntl() changes an errno to the unexpected value,
         * store the errno before calling fcntl.
@@ -286,10 +286,12 @@ static int net_would_block(const mbedtls_net_context *ctx)
        int errval = errno;
 #endif
        if ((fcntl(ctx->fd, F_GETFL) & O_NONBLOCK) != O_NONBLOCK) {
+#if defined(MBED_TIZENRT)
+               set_errno(errval);
+#endif
                return (0);
        }
-
-#ifdef CONFIG_OS_TINYARA
+#if defined(MBED_TIZENRT)
        set_errno(errval);
 #endif