[gjs] system: Remove getuid/getgid/getpid



commit 83e00e8d861102a30d2d0df9e3eb2c0d84064a37
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jan 2 14:02:04 2013 -0500

    system: Remove getuid/getgid/getpid
    
    The system module was to be intended for functions for the language
    system, not for OS support. We now have the static "posix" library
    to wrap calls like this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691030

 modules/system.c |   60 ------------------------------------------------------
 1 files changed, 0 insertions(+), 60 deletions(-)
---
diff --git a/modules/system.c b/modules/system.c
index 84d5b07..7ee9a2f 100644
--- a/modules/system.c
+++ b/modules/system.c
@@ -104,48 +104,6 @@ gjs_gc(JSContext *context,
     return JS_TRUE;
 }
 
-static JSBool
-gjs_getpid(JSContext *context,
-           unsigned   argc,
-           jsval     *vp)
-{
-    jsval *argv = JS_ARGV(cx, vp);
-    jsval rval;
-    if (!gjs_parse_args(context, "getpid", "", argc, argv))
-        return JS_FALSE;
-    rval = INT_TO_JSVAL(getpid());
-    JS_SET_RVAL(context, vp, rval);
-    return JS_TRUE;
-}
-
-static JSBool
-gjs_getuid(JSContext *context,
-           unsigned   argc,
-           jsval     *vp)
-{
-    jsval *argv = JS_ARGV(cx, vp);
-    jsval rval;
-    if (!gjs_parse_args(context, "getuid", "", argc, argv))
-        return JS_FALSE;
-    rval = INT_TO_JSVAL(getuid());
-    JS_SET_RVAL(context, vp, rval);
-    return JS_TRUE;
-}
-
-static JSBool
-gjs_getgid(JSContext *context,
-           unsigned   argc,
-           jsval     *vp)
-{
-    jsval *argv = JS_ARGV(cx, vp);
-    jsval rval;
-    if (!gjs_parse_args(context, "getgid", "", argc, argv))
-        return JS_FALSE;
-    rval = INT_TO_JSVAL(getgid());
-    JS_SET_RVAL(context, vp, rval);
-    return JS_TRUE;
-}
-
 JSBool
 gjs_js_define_system_stuff(JSContext *context,
                            JSObject  *module)
@@ -174,24 +132,6 @@ gjs_js_define_system_stuff(JSContext *context,
                            0, GJS_MODULE_PROP_FLAGS))
         return JS_FALSE;
 
-    if (!JS_DefineFunction(context, module,
-                           "getpid",
-                           (JSNative) gjs_getpid,
-                           0, GJS_MODULE_PROP_FLAGS))
-        return FALSE;
-
-    if (!JS_DefineFunction(context, module,
-                           "getuid",
-                           (JSNative) gjs_getuid,
-                           0, GJS_MODULE_PROP_FLAGS))
-        return FALSE;
-
-    if (!JS_DefineFunction(context, module,
-                           "getgid",
-                           (JSNative) gjs_getgid,
-                           0, GJS_MODULE_PROP_FLAGS))
-        return FALSE;
-
     return JS_TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]