[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Mon Mar 20 15:12:02 UTC 2017
The branch, master has been updated
via a181609 lib: Simplify smb_nanosleep
via 8f0ecb6 lib: Make sys_poll_intr available to ctdb
via 0b6156f lib: Avoid an includes.h
from e78b887 ctdb-tests: Catch cases where mktemp fails due to missing TMPDIR
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit a181609f94a71ea7e9fba2f1d9a5220a6bff9683
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jan 8 17:54:06 2017 +0000
lib: Simplify smb_nanosleep
We have the recalculation logic also in sys_poll_intr, don't duplicate it.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Mon Mar 20 16:11:16 CET 2017 on sn-devel-144
commit 8f0ecb660e23ed51451aca96b9bb1f8776fa1ad0
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 19 20:10:29 2017 +0100
lib: Make sys_poll_intr available to ctdb
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 0b6156f8dae3316f0cefb22d4c85e918d9b9ba22
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jan 8 19:52:47 2017 +0000
lib: Avoid an includes.h
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/util/select.c | 3 ++-
lib/util/util.c | 44 ++------------------------------------------
lib/util/wscript_build | 4 ++--
3 files changed, 6 insertions(+), 45 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/select.c b/lib/util/select.c
index 99cd772..dc79a27 100644
--- a/lib/util/select.c
+++ b/lib/util/select.c
@@ -18,10 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
#include "system/select.h"
#include "lib/util/select.h"
+#include "lib/util/time.h"
int sys_poll_intr(struct pollfd *fds, int num_fds, int timeout)
{
diff --git a/lib/util/util.c b/lib/util/util.c
index 49f1584..ef148e9 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -33,6 +33,7 @@
#include "system/wait.h"
#include "debug.h"
#include "samba_util.h"
+#include "lib/util/select.h"
#undef malloc
#undef strcasecmp
@@ -292,48 +293,7 @@ _PUBLIC_ bool directory_create_or_exist_strict(const char *dname,
_PUBLIC_ void smb_msleep(unsigned int t)
{
-#if defined(HAVE_NANOSLEEP)
- struct timespec ts;
- int ret;
-
- ts.tv_sec = t/1000;
- ts.tv_nsec = 1000000*(t%1000);
-
- do {
- errno = 0;
- ret = nanosleep(&ts, &ts);
- } while (ret < 0 && errno == EINTR && (ts.tv_sec > 0 || ts.tv_nsec > 0));
-#else
- unsigned int tdiff=0;
- struct timeval tval,t1,t2;
- fd_set fds;
-
- GetTimeOfDay(&t1);
- t2 = t1;
-
- while (tdiff < t) {
- tval.tv_sec = (t-tdiff)/1000;
- tval.tv_usec = 1000*((t-tdiff)%1000);
-
- /* Never wait for more than 1 sec. */
- if (tval.tv_sec > 1) {
- tval.tv_sec = 1;
- tval.tv_usec = 0;
- }
-
- FD_ZERO(&fds);
- errno = 0;
- select(0,&fds,NULL,NULL,&tval);
-
- GetTimeOfDay(&t2);
- if (t2.tv_sec < t1.tv_sec) {
- /* Someone adjusted time... */
- t1 = t2;
- }
-
- tdiff = usec_time_diff(&t2,&t1)/1000;
- }
-#endif
+ sys_poll_intr(NULL, 0, t);
}
/**
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index ddece0e..bd3cc62 100644
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -71,7 +71,7 @@ bld.SAMBA_SUBSYSTEM('samba-util-core',
source='''data_blob.c util_file.c time.c
signal.c util.c idtree.c fault.c
substitute.c util_process.c util_strlist.c
- strv_util.c bitmap.c''',
+ strv_util.c bitmap.c select.c''',
deps='''time-basic samba-debug socket-blocking talloc
tevent execinfo pthread strv''',
local_include=False)
@@ -113,7 +113,7 @@ else:
bld.SAMBA_LIBRARY('samba-util',
source='''talloc_stack.c smb_threads.c
- rbtree.c rfc1738.c become_daemon.c system.c select.c getpass.c
+ rbtree.c rfc1738.c become_daemon.c system.c getpass.c
genrand_util.c fsusage.c
params.c util_id.c util_net.c
util_strlist_v3.c util_paths.c
--
Samba Shared Repository
More information about the samba-cvs
mailing list