keys.scala, etc.: Make merging public keys have a progress bar.
[tripe-android] / jni.c
diff --git a/jni.c b/jni.c
index 9ca3651..3841f35 100644 (file)
--- a/jni.c
+++ b/jni.c
@@ -912,6 +912,21 @@ end:
   put_cstring(jni, path, pathstr);
 }
 
+JNIEXPORT void JNIFUNC(chmod)(JNIEnv *jni, jobject cls,
+                             jobject path, jint mode)
+{
+  const char *pathstr = 0;
+
+  pathstr = get_cstring(jni, path); if (!pathstr) goto end;
+  if (chmod(pathstr, mode)) {
+    except_syserror(jni, SYSERR, errno,
+                   "failed st permissions on `%s'", pathstr);
+    goto end;
+  }
+end:
+  put_cstring(jni, path, pathstr);
+}
+
 JNIEXPORT void JNIFUNC(mkfile)(JNIEnv *jni, jobject cls,
                            jobject path, jint mode)
 {