[sr-dev] git:master:f0ac15dc: tls: fix compilation warning

Victor Seva linuxmaniac at torreviejawireless.org
Tue Jun 7 12:19:56 CEST 2016


Module: kamailio
Branch: master
Commit: f0ac15dc896f959cb92ad85fd1426fac1aa0bb55
URL: https://github.com/kamailio/kamailio/commit/f0ac15dc896f959cb92ad85fd1426fac1aa0bb55

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2016-06-06T12:05:39+02:00

tls: fix compilation warning

> tls_config.c:403:6: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result]
>                                         write(out_fd, &ch, 1);
>                                         ^~~~~ ~~~~~~~~~~~~~~
> tls_config.c:408:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result]
>                                 write(out_fd, &ch, 1);
>                                 ^~~~~ ~~~~~~~~~~~~~~
> 2 warnings generated.

---

Modified: modules/tls/tls_config.c

---

Diff:  https://github.com/kamailio/kamailio/commit/f0ac15dc896f959cb92ad85fd1426fac1aa0bb55.diff
Patch: https://github.com/kamailio/kamailio/commit/f0ac15dc896f959cb92ad85fd1426fac1aa0bb55.patch

---

diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c
index af1d88a..fc63155 100644
--- a/modules/tls/tls_config.c
+++ b/modules/tls/tls_config.c
@@ -400,12 +400,16 @@ tls_domains_cfg_t* tls_load_config(str* filename)
 				pkg_free(file_path);
 				file_path = NULL;
 				while (read(in_fd, &ch, 1)) {
-					write(out_fd, &ch, 1);
+					if (write(out_fd, &ch, 1)<0) {
+						LOG(L_ERR, "write error: %s\n", strerror(errno));
+					}
 				}
 				close(in_fd);
 				in_fd = 0;
 				ch = '\n';
-				write(out_fd, &ch, 1);
+				if (write(out_fd, &ch, 1)<0) {
+					LOG(L_ERR, "write error: %s\n", strerror(errno));
+				}
 			}
 		}
 		closedir(dir);




More information about the sr-dev mailing list