about summary refs log tree commit diff
path: root/shared/nm-utils
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-07-01 20:59:09 +0200
committerMichael Biebl <biebl@debian.org>2018-07-01 20:59:09 +0200
commit6106f75cc14c2d8af6999bd28dd075c32411deaf (patch)
tree2e084cc81011fc5cec703704f2ff5b65f5a7fa8d /shared/nm-utils
parente8b3308b1970e9b71b443479351e173cb89e3800 (diff)
parent429393567647935d9123e21fd27a7529d50255eb (diff)
Update upstream source from tag 'upstream/1.12.0'
Update to upstream version '1.12.0'
with Debian dir 76506925b30952acfa95c8f5b789bcfb2a8e3a6e
Diffstat (limited to 'shared/nm-utils')
-rw-r--r--shared/nm-utils/nm-shared-utils.h3
-rw-r--r--shared/nm-utils/nm-test-utils.h8
2 files changed, 10 insertions, 1 deletions
diff --git a/shared/nm-utils/nm-shared-utils.h b/shared/nm-utils/nm-shared-utils.h
index 58855237..d983cfcd 100644
--- a/shared/nm-utils/nm-shared-utils.h
+++ b/shared/nm-utils/nm-shared-utils.h
@@ -331,6 +331,7 @@ _nm_g_slice_free_fcn_define (1)
 _nm_g_slice_free_fcn_define (2)
 _nm_g_slice_free_fcn_define (4)
 _nm_g_slice_free_fcn_define (8)
+_nm_g_slice_free_fcn_define (10)
 _nm_g_slice_free_fcn_define (12)
 _nm_g_slice_free_fcn_define (16)
 
@@ -345,6 +346,7 @@ _nm_g_slice_free_fcn_define (16)
 		                      || ((mem_size) ==  2) \
 		                      || ((mem_size) ==  4) \
 		                      || ((mem_size) ==  8) \
+		                      || ((mem_size) == 10) \
 		                      || ((mem_size) == 12) \
 		                      || ((mem_size) == 16)); \
 		switch ((mem_size)) { \
@@ -352,6 +354,7 @@ _nm_g_slice_free_fcn_define (16)
 		case  2: _fcn = _nm_g_slice_free_fcn_2;  break; \
 		case  4: _fcn = _nm_g_slice_free_fcn_4;  break; \
 		case  8: _fcn = _nm_g_slice_free_fcn_8;  break; \
+		case 10: _fcn = _nm_g_slice_free_fcn_10; break; \
 		case 12: _fcn = _nm_g_slice_free_fcn_12; break; \
 		case 16: _fcn = _nm_g_slice_free_fcn_16; break; \
 		default: g_assert_not_reached (); _fcn = NULL; break; \
diff --git a/shared/nm-utils/nm-test-utils.h b/shared/nm-utils/nm-test-utils.h
index efbe6c9a..efb41454 100644
--- a/shared/nm-utils/nm-test-utils.h
+++ b/shared/nm-utils/nm-test-utils.h
@@ -145,10 +145,16 @@
 		const gint64 nmtst_wait_start_us = g_get_monotonic_time (); \
 		const gint64 nmtst_wait_duration_us = (max_wait_ms) * 1000L; \
 		const gint64 nmtst_wait_end_us = nmtst_wait_start_us + nmtst_wait_duration_us; \
+		gint64 _nmtst_wait_remaining_us = nmtst_wait_duration_us; \
+		int _nmtst_wait_iteration = 0; \
 		\
 		while (TRUE) { \
+			_nm_unused const gint64 nmtst_wait_remaining_us = _nmtst_wait_remaining_us; \
+			_nm_unused int nmtst_wait_iteration = _nmtst_wait_iteration++; \
+			\
 			{ wait }; \
-			if (g_get_monotonic_time () > nmtst_wait_end_us) { \
+			_nmtst_wait_remaining_us = (nmtst_wait_end_us - g_get_monotonic_time ()); \
+			if (_nmtst_wait_remaining_us <= 0) { \
 				_not_expired = FALSE; \
 				break; \
 			} \