PKG_PROG_PKG_CONFIG
AM_CONDITIONAL([CYGWIN], [test "$host_os" = cygwin])
+AM_COND_IF([CYGWIN],
+ [AC_DEFINE([USING_CYGWIN], [1], [Building Under Cygwin.])],
+ [])
# Check bytes in types.
AC_CHECK_SIZEOF([unsigned char], [1])
if (f <= 0.0)
return ActionNone;
- if (getuid() != 0 && f < 1.0)
+ if (!running_as_root() && (f < 1.0))
return ActionNone;
ctl->WaitTime = f;
/* allow root only to set zero delay */
Adjustment = (GtkAdjustment *) gtk_adjustment_new(ctl->WaitTime,
- getuid() ==
- 0 ? 0.01 : 1.00,
+ running_as_root() ? 0.01 : 1.00,
999.99, 1.0, 10.0,
0.0);
Button = gtk_spin_button_new(Adjustment, 0.5, 2);
if (ctl->WaitTime <= 0.0) {
error(EXIT_FAILURE, 0, "wait time must be positive");
}
- if (getuid() != 0 && ctl->WaitTime < 1.0) {
+ if (!running_as_root() && ctl->WaitTime < 1.0) {
error(EXIT_FAILURE, 0,
"non-root users cannot request an interval < 1.0 seconds");
}
char labels; /* how many labels did we get? */
};
+
+#ifdef USING_CYGWIN
+#define running_as_root() 1
+#else
+#define running_as_root() (getuid() != 0)
+#endif
+
#endif /* MTR_MTR_H */