Compare commits

..

3 Commits

Author SHA1 Message Date
Rahul Padigela 5890c69d13 skip on windows 2023-06-20 15:40:28 -07:00
Rahul Padigela c8d5d8ba7b change conditional 2023-06-20 15:35:32 -07:00
Rahul Padigela 5a1afee140 skip install on windows 2023-06-20 15:25:27 -07:00
4 changed files with 15 additions and 20 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
build
node_modules

View File

@ -7,10 +7,6 @@ fs.open('foo', 'w+', function(err, fd) {
} }
ret = posixFadvise(fd, 0, 10, 4); ret = posixFadvise(fd, 0, 10, 4);
console.log('posixFadvise ret:', ret); console.log('posixFadvise ret: ' + ret);
fs.close(fd, err => { fs.close(fd);
if (err) {
throw err;
}
});
}); });

View File

@ -1,14 +1,11 @@
{ {
"name": "fcntl", "name": "fcntl",
"version": "0.2.1", "version": "0.1.0",
"engines": {
"node": ">=10"
},
"description": "fcntl wrapper for nodejs", "description": "fcntl wrapper for nodejs",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"install": "node-gyp rebuild", "test": "echo \"Error: no test specified\" && exit 1",
"test": "echo \"Error: no test specified\" && exit 1" "install": "node-gyp rebuild"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -25,9 +22,13 @@
"url": "https://github.com/scality/node-fcntl/issues" "url": "https://github.com/scality/node-fcntl/issues"
}, },
"homepage": "https://github.com/scality/node-fcntl#readme", "homepage": "https://github.com/scality/node-fcntl#readme",
"gypfile": true,
"dependencies": { "dependencies": {
"bindings": "^1.1.1", "bindings": "^1.1.1",
"nan": "^2.3.2", "nan": "^2.3.2"
"node-gyp": "^8.0.0" },
"scripts": {
"install": "node-gyp rebuild",
"test": "echo \"Error: no test specified\" && exit 1"
} }
} }

View File

@ -36,10 +36,10 @@ NAN_METHOD(PosixFadvise) {
Nan::ThrowTypeError("Argument 1 Must be an Integer"); Nan::ThrowTypeError("Argument 1 Must be an Integer");
} }
int fd = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust(); int fd = info[0]->Int32Value();
off_t offset = (off_t) info[1]->NumberValue(Nan::GetCurrentContext()).FromJust(); off_t offset = (off_t) info[1]->NumberValue();
off_t len = (off_t) info[2]->NumberValue(Nan::GetCurrentContext()).FromJust(); off_t len = (off_t) info[2]->NumberValue();
unsigned long advice = info[3]->IntegerValue(Nan::GetCurrentContext()).FromJust(); unsigned long advice = info[3]->IntegerValue();
int res = posix_fadvise(fd, offset, len, advice); int res = posix_fadvise(fd, offset, len, advice);
if (res < 0) { if (res < 0) {