Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Dir.create()
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-leonov committed Jun 3, 2010
1 parent 168362f commit 83655de
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/classes/Dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ JSClass ngx_http_js__nginx_dir__class;
static JSBool
method_create(JSContext *cx, JSObject *self, uintN argc, jsval *argv, jsval *rval)
{
ngx_uint_t access;
JSString *jss_path;
jsdouble dp;
const char *path;
Expand All @@ -50,15 +51,21 @@ method_create(JSContext *cx, JSObject *self, uintN argc, jsval *argv, jsval *rva
}


if (!JS_ValueToNumber(cx, argv[0], &dp))
if (!JS_ValueToNumber(cx, argv[1], &dp))
{
// forward exception if any
return JS_FALSE;
}

access = dp;

ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0, "ngx_create_dir(\"%s\", %d)", path, (int) dp);
*rval = INT_TO_JSVAL(ngx_create_dir(path, dp));
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0, "ngx_create_dir(\"%s\", %d)", path, access);
*rval = INT_TO_JSVAL(ngx_create_dir(path, access));

return JS_TRUE;
}



return JS_TRUE;
}
Expand Down

0 comments on commit 83655de

Please sign in to comment.