<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,7 @@
 #include &lt;string.h&gt;
 #include &lt;sys/time.h&gt;
 #include &lt;time.h&gt;
+#include &lt;signal.h&gt;
 
 /* Subtract the `struct timeval' values X and Y,
    storing the result in RESULT.
@@ -142,6 +143,10 @@ void dump_profile() {
     }
 }
 
+void handle_sigint(int sig) {
+    CPU.halt = 1;
+}
+
 int main(int argc, char **argv)
 {
     int fd;
@@ -171,6 +176,7 @@ int main(int argc, char **argv)
     close(fd);
 
     bcpu_reset();
+    signal(SIGINT, handle_sigint);
 
     if(cpu_options.enable_clock) {
         start_clock();</diff>
      <filename>bemu.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7af177916584be5aec715a4a562a827ebd11fa4d</id>
    </parent>
  </parents>
  <author>
    <name>Nelson Elhage</name>
    <email>nelhage@mit.edu</email>
  </author>
  <url>http://github.com/nelhage/bemu/commit/12ef7d6f0e3e4feb18cad80e164d6f1bbf062eca</url>
  <id>12ef7d6f0e3e4feb18cad80e164d6f1bbf062eca</id>
  <committed-date>2009-11-08T19:46:59-08:00</committed-date>
  <authored-date>2009-11-08T19:46:59-08:00</authored-date>
  <message>Attempt to shut the CPU down cleanly on a SIGINT.</message>
  <tree>4c6d7d1d342b3d478149fb1db4cf381ba9dd2eee</tree>
  <committer>
    <name>Nelson Elhage</name>
    <email>nelhage@mit.edu</email>
  </committer>
</commit>
