From 1785e31f6019d458077a8e7d1f14afa48abbb18e Mon Sep 17 00:00:00 2001
From: winckel <winckel@eurecom.fr>
Date: Tue, 26 Nov 2013 13:27:04 +0000
Subject: [PATCH] Fixed some warnings.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4523 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair2/UTIL/LOG/log.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index 01852a96b5..a741841d73 100755
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -482,10 +482,14 @@ void logRecord_thread_safe(const char *file, const char *func,
         syslog(g_log->level, "%s", log_buffer);
     }
     if (g_log->filelog) {
-        write(gfd, log_buffer, total_len);
+      if (write(gfd, log_buffer, total_len) < total_len) {
+        // TODO assert ?
+      }
     }
     if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
-        write(g_log->log_component[comp].fd, log_buffer, total_len);
+      if (write(g_log->log_component[comp].fd, log_buffer, total_len) < total_len) {
+        // TODO assert ?
+      }
     }
 #endif
 
@@ -637,10 +641,14 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
         syslog(g_log->level, "%s", c->log_buffer);
     }
     if (g_log->filelog) {
-        write(gfd, c->log_buffer, len);
+      if (write(gfd, c->log_buffer, len) < len){
+        // TODO assert ?
+      }
     }
     if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
-        write(g_log->log_component[comp].fd, c->log_buffer, len);
+      if (write(g_log->log_component[comp].fd, c->log_buffer, len) < len) {
+        // TODO assert ?
+      }
     }
 #endif
 
-- 
GitLab