}
}
+bool
+str_to_uint(const char *s, int base, unsigned int *u)
+{
+ long long ll;
+ bool ok = str_to_llong(s, base, &ll);
+ if (!ok || ll < 0 || ll > UINT_MAX) {
+ *u = 0;
+ return false;
+ } else {
+ *u = ll;
+ return true;
+ }
+}
+
/* Converts floating-point string 's' into a double. If successful, stores
* the double in '*d' and returns true; on failure, stores 0 in '*d' and
* returns false.
return ok;
}
-unsigned int
+void
xsleep(unsigned int seconds)
{
- unsigned int t;
-
ovsrcu_quiesce_start();
- t = sleep(seconds);
+#ifdef _WIN32
+ Sleep(seconds * 1000);
+#else
+ sleep(seconds);
+#endif
ovsrcu_quiesce_end();
- return t;
}
#ifdef _WIN32