The branch, v3-3-test has been updated
       via  dfd983881341bfbc811199901ae3d8fe973649c1 (commit)
      from  2d6946bf3a3b7465c92e707ef136e34996ae90be (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit dfd983881341bfbc811199901ae3d8fe973649c1
Author: Jeremy Allison <jer...@jeremy-desktop.(none)>
Date:   Mon Dec 22 20:05:45 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:
 source/lib/socket_wrapper/socket_wrapper.c |   12 ++++++++++--
 source/libnet/libnet_join.c                |    3 +--
 2 files changed, 11 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/socket_wrapper/socket_wrapper.c 
b/source/lib/socket_wrapper/socket_wrapper.c
index 33e4b38..cee43c0 100644
--- a/source/lib/socket_wrapper/socket_wrapper.c
+++ b/source/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/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 8abd317..b8d903c 100644
--- a/source/libnet/libnet_join.c
+++ b/source/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

Reply via email to