X-Git-Url: https://git.distorted.org.uk/~mdw/tripe-android/blobdiff_plain/3bb2303d42adb3f37420f168b009ecfe64f888cd..HEAD:/jni.c diff --git a/jni.c b/jni.c index 9ca3651..3841f35 100644 --- 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) {