Some more infrastructure. Maybe other things.
[tripe-android] / sys.scala
index 8dab4c6..c449414 100644 (file)
--- a/sys.scala
+++ b/sys.scala
@@ -38,6 +38,8 @@ import java.nio.{ByteBuffer, CharBuffer};
 import java.nio.charset.Charset;
 import java.util.Date;
 
+import Implicits.truish;
+
 /*----- Some magic for C strings ------------------------------------------*/
 
 type CString = Array[Byte];
@@ -797,7 +799,7 @@ def runCommand(cmd: String*): (String, String) = {
 
     /* Check the exit status. */
     val rc = kid.exitValue;
-    if (rc != 0) throw new SubprocessFailed(cmd, rc, berr.result);
+    if (rc) throw new SubprocessFailed(cmd, rc, berr.result);
 
     /* We're all done. */
     return (bout.result, berr.result);
@@ -818,7 +820,7 @@ private var triggers: List[Wrapper] = Nil;
 
 private def getTrigger(): Wrapper = {
   triggerLock synchronized {
-    if (nTriggers == 0)
+    if (!nTriggers)
       make_trigger()
     else {
       val trig = triggers.head;