[SCM] Samba Shared Repository - branch master updated -
aaea68791cfea45c6fa69abc93ad6d0e832d0283
Jeremy Allison
jra at samba.org
Tue Dec 23 04:08:13 GMT 2008
The branch, master has been updated
via aaea68791cfea45c6fa69abc93ad6d0e832d0283 (commit)
from a7f64ba2f1d49b65cd96ba862f6b80b28c3e6dd2 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit aaea68791cfea45c6fa69abc93ad6d0e832d0283
Author: Jeremy Allison <jeremy at jeremy-desktop.(none)>
Date: Mon Dec 22 20:08:14 2008 -0800
In gcc version 4.3.2 we get warnings for functions declared with
attribute warn_unused_result. Start to fix these.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
lib/socket_wrapper/socket_wrapper.c | 12 ++++++++++--
source3/libnet/libnet_join.c | 3 +--
2 files changed, 11 insertions(+), 4 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 9d61976..dc0124b 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -899,7 +899,10 @@ static int swrap_get_pcap_fd(const char *fname)
file_hdr.frame_max_len = SWRAP_FRAME_LENGTH_MAX;
file_hdr.link_type = 0x0065; /* 101 RAW IP */
- write(fd, &file_hdr, sizeof(file_hdr));
+ if (write(fd, &file_hdr, sizeof(file_hdr)) != sizeof(file_hdr)) {
+ close(fd);
+ return -1;
+ }
return fd;
}
@@ -1190,7 +1193,12 @@ static void swrap_dump_packet(struct socket_info *si,
fd = swrap_get_pcap_fd(file_name);
if (fd != -1) {
- write(fd, packet, packet_len);
+ if (write(fd, packet, packet_len) != packet_len) {
+ close(fd);
+ free(packet);
+ return;
+ }
+ close(fd);
}
free(packet);
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 691f6ff..51d9790 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1019,8 +1019,7 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name,
return NT_STATUS_NO_TRUST_LSA_SECRET;
}
- asprintf(&machine_account, "%s$", machine_name);
- if (!machine_account) {
+ if (asprintf(&machine_account, "%s$", machine_name) == -1) {
SAFE_FREE(machine_password);
return NT_STATUS_NO_MEMORY;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list