summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>2005-01-12 22:16:02 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>2005-01-12 22:16:02 +0000
commit0eb1b9fabce12091d8aef1e14041dea4cee4b995 (patch)
tree3e40c2543b813b1393e5373df0d888adec3ad389
parent[MAINTAINER] Update port: databases/py-MySQLdb-devel to 1.1.8 (diff)
Fix a possible division by zero condition that can happen for very
short (< 1 ms) simulations.
Notes
Notes: svn path=/head/; revision=126269
-rw-r--r--devel/simulavr/Makefile2
-rw-r--r--devel/simulavr/files/patch-src::avrcore.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/devel/simulavr/Makefile b/devel/simulavr/Makefile
index 944cc1ecfb5f..d00bcd71e798 100644
--- a/devel/simulavr/Makefile
+++ b/devel/simulavr/Makefile
@@ -7,7 +7,7 @@
PORTNAME= simulavr
PORTVERSION= 0.1.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/devel/simulavr/files/patch-src::avrcore.c b/devel/simulavr/files/patch-src::avrcore.c
new file mode 100644
index 000000000000..a5e1ce605e7e
--- /dev/null
+++ b/devel/simulavr/files/patch-src::avrcore.c
@@ -0,0 +1,12 @@
+--- src/avrcore.c.orig Fri Jan 2 04:01:01 2004
++++ src/avrcore.c Wed Jan 12 22:31:53 2005
+@@ -1067,6 +1067,9 @@
+
+ signal_watch_stop (SIGINT);
+
++ /* avoid division by zero below */
++ if (run_time == 0) run_time = 1;
++
+ avr_message ("Run time was %lld.%03lld seconds.\n", run_time / 1000,
+ run_time % 1000);
+ avr_message ("Executed %lld instructions.\n", cnt);