[SCM] Samba Shared Repository - branch master updated

[email protected] (Amitay Isaacs)
Newsgroups gmane.network.samba.cvs
Message-ID <[email protected]>
The branch, master has been updated
       via  bdc049d ctdb-common: Drop CTDB's copy of sys_read() and sys_write()
       via  dcde6f1 ctdb-lock-helper: Drop include of ctdb_private.h
       via  de22783 lib/util: Make sys_rw available to CTDB
      from  4ca7d50 ntlm_auth4: Remove it

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bdc049dfcea9756f4d5a1f2ad6fb0685181f8ad0
Author: Martin Schwenke <[email protected]>
Date:   Tue Nov 29 12:55:06 2016 +1100

    ctdb-common: Drop CTDB's copy of sys_read() and sys_write()
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Reviewed-by: Amitay Isaacs <[email protected]>
    
    Autobuild-User(master): Amitay Isaacs <[email protected]>
    Autobuild-Date(master): Tue Nov 29 11:22:40 CET 2016 on sn-devel-144

commit dcde6f16194ea3fbff73d65773bde3ef7dea929f
Author: Martin Schwenke <[email protected]>
Date:   Tue Nov 29 12:54:00 2016 +1100

    ctdb-lock-helper: Drop include of ctdb_private.h
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Reviewed-by: Amitay Isaacs <[email protected]>

commit de22783f73393f1f6d0f203dad45fb81deb3f117
Author: Martin Schwenke <[email protected]>
Date:   Tue Nov 29 12:21:33 2016 +1100

    lib/util: Make sys_rw available to CTDB
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Reviewed-by: Amitay Isaacs <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/common/ctdb_io.c                 |  2 +-
 ctdb/common/system.h                  |  3 ---
 ctdb/common/system_util.c             | 34 ----------------------------------
 ctdb/server/ctdb_call.c               |  1 +
 ctdb/server/ctdb_cluster_mutex.c      |  2 +-
 ctdb/server/ctdb_event_helper.c       |  1 +
 ctdb/server/ctdb_lock.c               |  2 +-
 ctdb/server/ctdb_lock_helper.c        |  5 ++++-
 ctdb/server/ctdb_logging.c            |  2 +-
 ctdb/server/ctdb_logging_file.c       |  3 +--
 ctdb/server/ctdb_mutex_fcntl_helper.c |  2 ++
 ctdb/server/ctdb_recoverd.c           |  1 +
 ctdb/server/ctdb_recovery_helper.c    | 15 +--------------
 ctdb/server/ctdb_takeover.c           |  1 +
 ctdb/server/ctdb_traverse.c           |  1 +
 ctdb/server/ctdb_update_record.c      |  1 +
 ctdb/server/ctdb_vacuum.c             |  2 +-
 ctdb/server/eventscript.c             |  2 +-
 ctdb/tools/ctdb.c                     |  1 +
 ctdb/wscript                          | 15 ++++++++-------
 lib/util/wscript_build                | 12 ++++++------
 21 files changed, 35 insertions(+), 73 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c
index 806c57f..152d535 100644
--- a/ctdb/common/ctdb_io.c
+++ b/ctdb/common/ctdb_io.c
@@ -30,11 +30,11 @@
 
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
+#include "lib/util/sys_rw.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
 
-#include "common/system.h"
 #include "common/logging.h"
 #include "common/common.h"
 
diff --git a/ctdb/common/system.h b/ctdb/common/system.h
index 2007814..2875760 100644
--- a/ctdb/common/system.h
+++ b/ctdb/common/system.h
@@ -60,9 +60,6 @@ void lockdown_memory(bool valgrinding);
 int mkdir_p(const char *dir, int mode);
 void mkdir_p_or_die(const char *dir, int mode);
 
-ssize_t sys_read(int fd, void *buf, size_t count);
-ssize_t sys_write(int fd, const void *buf, size_t count);
-
 void ctdb_wait_for_process_to_exit(pid_t pid);
 
 int ctdb_parse_connections(FILE *fp, TALLOC_CTX *mem_ctx,
diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c
index 9e897c2..57452aa 100644
--- a/ctdb/common/system_util.c
+++ b/ctdb/common/system_util.c
@@ -349,40 +349,6 @@ void mkdir_p_or_die(const char *dir, int mode)
 	}
 }
 
-/* A read wrapper that will deal with EINTR.  For now, copied from
- * source3/lib/system.c
- */
-ssize_t sys_read(int fd, void *buf, size_t count)
-{
-        ssize_t ret;
-
-        do {
-                ret = read(fd, buf, count);
-#if defined(EWOULDBLOCK)
-        } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
-        } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
-        return ret;
-}
-
-/* A write wrapper that will deal with EINTR.  For now, copied from
- * source3/lib/system.c
- */
-ssize_t sys_write(int fd, const void *buf, size_t count)
-{
-        ssize_t ret;
-
-        do {
-                ret = write(fd, buf, count);
-#if defined(EWOULDBLOCK)
-        } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
-        } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
-        return ret;
-}
-
 void ctdb_wait_for_process_to_exit(pid_t pid)
 {
 	while (kill(pid, 0) == 0 || errno != ESRCH) {
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c
index 3478419..6704911 100644
--- a/ctdb/server/ctdb_call.c
+++ b/ctdb/server/ctdb_call.c
@@ -30,6 +30,7 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
diff --git a/ctdb/server/ctdb_cluster_mutex.c b/ctdb/server/ctdb_cluster_mutex.c
index 3448491..9397746 100644
--- a/ctdb/server/ctdb_cluster_mutex.c
+++ b/ctdb/server/ctdb_cluster_mutex.c
@@ -28,12 +28,12 @@
 #include "lib/util/time.h"
 #include "lib/util/strv.h"
 #include "lib/util/strv_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/blocking.h"
 
 #include "ctdb_private.h"
 #include "common/common.h"
 #include "common/logging.h"
-#include "common/system.h"
 
 #include "ctdb_cluster_mutex.h"
 
diff --git a/ctdb/server/ctdb_event_helper.c b/ctdb/server/ctdb_event_helper.c
index 7b6e843..5e48b9c 100644
--- a/ctdb/server/ctdb_event_helper.c
+++ b/ctdb/server/ctdb_event_helper.c
@@ -25,6 +25,7 @@
 #include <talloc.h>
 
 #include "lib/util/blocking.h"
+#include "lib/util/sys_rw.h"
 
 #include "ctdb_private.h"
 
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c
index 3a58711..139ead0 100644
--- a/ctdb/server/ctdb_lock.c
+++ b/ctdb/server/ctdb_lock.c
@@ -28,10 +28,10 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 
 #include "ctdb_private.h"
 
-#include "common/system.h"
 #include "common/common.h"
 #include "common/logging.h"
 
diff --git a/ctdb/server/ctdb_lock_helper.c b/ctdb/server/ctdb_lock_helper.c
index 8aa0870..d7f8fe1 100644
--- a/ctdb/server/ctdb_lock_helper.c
+++ b/ctdb/server/ctdb_lock_helper.c
@@ -22,8 +22,11 @@
 #include "system/network.h"
 
 #include <talloc.h>
+#include <tdb.h>
 
-#include "ctdb_private.h"
+#include "lib/util/sys_rw.h"
+
+#include "protocol/protocol.h"
 
 #include "common/system.h"
 
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index fbafe9b..87dbd3b 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -29,12 +29,12 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/blocking.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/time.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
 
-#include "common/system.h"
 #include "common/common.h"
 #include "common/logging.h"
 
diff --git a/ctdb/server/ctdb_logging_file.c b/ctdb/server/ctdb_logging_file.c
index 488de26..fc6720b 100644
--- a/ctdb/server/ctdb_logging_file.c
+++ b/ctdb/server/ctdb_logging_file.c
@@ -25,13 +25,12 @@
 #include <talloc.h>
 
 #include "lib/util/debug.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/time_basic.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
 
-#include "common/system.h"
-
 #define CTDB_LOG_FILE_PREFIX "file"
 
 struct file_state {
diff --git a/ctdb/server/ctdb_mutex_fcntl_helper.c b/ctdb/server/ctdb_mutex_fcntl_helper.c
index 87358be..7b66c78 100644
--- a/ctdb/server/ctdb_mutex_fcntl_helper.c
+++ b/ctdb/server/ctdb_mutex_fcntl_helper.c
@@ -21,6 +21,8 @@
 #include "system/filesys.h"
 #include "system/network.h"
 
+#include "lib/util/sys_rw.h"
+
 /* protocol.h is just needed for ctdb_sock_addr, which is used in system.h */
 #include "protocol/protocol.h"
 #include "common/system.h"
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 6861833..c310102 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -32,6 +32,7 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c
index 7dfb707..09bc989 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -27,6 +27,7 @@
 #include <libgen.h>
 
 #include "lib/tdb_wrap/tdb_wrap.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/time.h"
 #include "lib/util/tevent_unix.h"
 
@@ -55,20 +56,6 @@ static void LOG(const char *fmt, ...)
  * Utility functions
  */
 
-static ssize_t sys_write(int fd, const void *buf, size_t count)
-{
-        ssize_t ret;
-
-        do {
-                ret = write(fd, buf, count);
-#if defined(EWOULDBLOCK)
-        } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
-        } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
-        return ret;
-}
-
 static bool generic_recv(struct tevent_req *req, int *perr)
 {
 	int err;
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index f71c5fb..c2ae1df 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -30,6 +30,7 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
diff --git a/ctdb/server/ctdb_traverse.c b/ctdb/server/ctdb_traverse.c
index 11a5385..1f95042 100644
--- a/ctdb/server/ctdb_traverse.c
+++ b/ctdb/server/ctdb_traverse.c
@@ -30,6 +30,7 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
diff --git a/ctdb/server/ctdb_update_record.c b/ctdb/server/ctdb_update_record.c
index 56f3b83..63d1b5c 100644
--- a/ctdb/server/ctdb_update_record.c
+++ b/ctdb/server/ctdb_update_record.c
@@ -28,6 +28,7 @@
 #include "lib/tdb_wrap/tdb_wrap.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index 174ccb2..5ffab1d 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -31,13 +31,13 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 #include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
 
 #include "common/rb_tree.h"
-#include "common/system.h"
 #include "common/common.h"
 #include "common/logging.h"
 
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 86d37d9..8f6ffd1 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -31,11 +31,11 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 
 #include "ctdb_private.h"
 
 #include "common/rb_tree.h"
-#include "common/system.h"
 #include "common/common.h"
 #include "common/logging.h"
 
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index a1024ae..5971975 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -32,6 +32,7 @@
 #include "ctdb_version.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
 
 #include "common/db_hash.h"
 #include "common/logging.h"
diff --git a/ctdb/wscript b/ctdb/wscript
index a69e57b..f4bccef 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -412,7 +412,8 @@ def build(bld):
                                              ctdb_update_record.c
                                              ctdb_lock.c ctdb_fork.c'''),
                         includes='include',
-                        deps='ctdb-ipalloc replace popt talloc tevent tdb talloc_report')
+                        deps='''ctdb-ipalloc replace sys_rw
+                                popt talloc tevent tdb talloc_report''')
 
     bld.SAMBA_BINARY('ctdbd',
                      source='',
@@ -425,7 +426,7 @@ def build(bld):
     bld.SAMBA_BINARY('ctdb',
                      source='tools/ctdb.c',
                      deps='''ctdb-client2 ctdb-protocol ctdb-util ctdb-system
-                             samba-util popt''',
+                             samba-util sys_rw popt''',
                      install_path='${BINDIR}',
                      manpages='ctdb.1')
 
@@ -444,25 +445,25 @@ def build(bld):
 
     bld.SAMBA_BINARY('ctdb_lock_helper',
                      source='server/ctdb_lock_helper.c',
-                     deps='samba-util ctdb-system talloc tdb',
+                     deps='samba-util sys_rw ctdb-system talloc tdb',
                      includes='include',
                      install_path='${CTDB_HELPER_BINDIR}')
 
     bld.SAMBA_BINARY('ctdb_event_helper',
                      source='server/ctdb_event_helper.c',
                      includes='include',
-                     deps='samba-util ctdb-system replace tdb',
+                     deps='samba-util sys_rw ctdb-system replace tdb',
                      install_path='${CTDB_HELPER_BINDIR}')
 
     bld.SAMBA_BINARY('ctdb_recovery_helper',
                      source='server/ctdb_recovery_helper.c',
                      deps='''ctdb-client2 ctdb-protocol ctdb-util
-                             samba-util replace tdb''',
+                             samba-util sys_rw replace tdb''',
                      install_path='${CTDB_HELPER_BINDIR}')
 
     bld.SAMBA_BINARY('ctdb_mutex_fcntl_helper',
                      source='server/ctdb_mutex_fcntl_helper.c',
-                     deps='ctdb-system',
+                     deps='sys_rw ctdb-system',
                      includes='include',
                      install_path='${CTDB_HELPER_BINDIR}')
 
@@ -739,7 +740,7 @@ def build(bld):
         bld.SAMBA_BINARY('ibwrapper_test',
                          source='ib/ibwrapper_test.c',
                          includes='include',
-                         deps='replace talloc ctdb-client ctdb-common' +
+                         deps='replace talloc ctdb-client ctdb-common sys_rw' +
                               ib_deps,
                          install_path='${CTDB_TEST_LIBEXECDIR}')
 
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 9b51f0e..0a911a2 100755
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -29,6 +29,12 @@ bld.SAMBA_SUBSYSTEM('close-low-fd',
                     deps='replace',
                     local_include=False)
 
+bld.SAMBA_LIBRARY('sys_rw',
+                  source='sys_rw.c sys_rw_data.c',
+                  deps='replace iov_buf',
+                  local_include=False,
+                  private_library=True)
+
 samba_debug_add_deps = ''
 samba_debug_add_inc  = ''
 
@@ -81,12 +87,6 @@ bld.SAMBA_LIBRARY('msghdr',
                   local_include=False,
                   private_library=True)
 
-bld.SAMBA_LIBRARY('sys_rw',
-                  source='sys_rw.c sys_rw_data.c',
-                  deps='replace iov_buf',
-                  local_include=False,
-                  private_library=True)
-
 if bld.env.SAMBA_UTIL_CORE_ONLY:
 
     bld.SAMBA_LIBRARY('tevent-util',


-- 
Samba Shared Repository
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.