summaryrefslogtreecommitdiff
path: root/gprof/hertz.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2000-05-26 13:11:57 +0000
committerAlan Modra <amodra@bigpond.net.au>2000-05-26 13:11:57 +0000
commit0ec238fa07cba008eba87c85d917d849fcb4c492 (patch)
tree63de07d189bc1be9db1080c93c385aab223e0ede /gprof/hertz.c
parent20b373ea5e261308d08c71629f0c6ac2b652b0ea (diff)
downloadbinutils-redhat-0ec238fa07cba008eba87c85d917d849fcb4c492.tar.gz
Eli Zaretskii's DOSish file name patches.
Diffstat (limited to 'gprof/hertz.c')
-rw-r--r--gprof/hertz.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gprof/hertz.c b/gprof/hertz.c
index 75314acc0c..a7fc14ed7f 100644
--- a/gprof/hertz.c
+++ b/gprof/hertz.c
@@ -19,10 +19,6 @@
#include "hertz.h"
-#ifdef __MSDOS__
-#define HERTZ 18
-#endif
-
int
hertz ()
{
@@ -38,17 +34,19 @@ hertz ()
tim.it_value.tv_usec = 0;
setitimer (ITIMER_REAL, &tim, 0);
setitimer (ITIMER_REAL, 0, &tim);
- if (tim.it_interval.tv_usec < 2)
+ if (tim.it_interval.tv_usec >= 2)
{
- return HZ_WRONG;
+ return 1000000 / tim.it_interval.tv_usec;
}
- return 1000000 / tim.it_interval.tv_usec;
-#else /* ! defined (HAVE_SETITIMER) */
+#endif /* ! defined (HAVE_SETITIMER) */
#if defined (HAVE_SYSCONF) && defined (_SC_CLK_TCK)
return sysconf (_SC_CLK_TCK);
#else /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
+#ifdef __MSDOS__
+ return 18;
+#else /* ! defined (__MSDOS__) */
return HZ_WRONG;
+#endif /* ! defined (__MSDOS__) */
#endif /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
-#endif /* ! defined (HAVE_SETITIMER) */
#endif /* ! defined (HERTZ) */
}