Skip to content

Commit 97e7646

Browse files
committedAug 16, 2017
unpack: don't call process.getgid() unnecessarily
1 parent 95049b6 commit 97e7646

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎lib/unpack.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class Unpack extends Parser {
234234
fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, cb))
235235
if (this[DOCHOWN](entry))
236236
queue.push(cb =>
237-
fs.chown(entry.absolute, entry.uid, entry.gid || process.getgid(), cb))
237+
fs.chown(entry.absolute, entry.uid, entry.gid || this.processGid, cb))
238238

239239
processQueue()
240240
})
@@ -373,7 +373,7 @@ class UnpackSync extends Unpack {
373373
}
374374
if (this[DOCHOWN](entry)) {
375375
try {
376-
fs.fchownSync(fd, entry.uid, entry.gid || process.getgid())
376+
fs.fchownSync(fd, entry.uid, entry.gid || this.processGid)
377377
} catch (er) {}
378378
}
379379
try { fs.closeSync(fd) } catch (er) { this[ONERROR](er, entry) }
@@ -393,7 +393,7 @@ class UnpackSync extends Unpack {
393393
}
394394
if (this[DOCHOWN](entry)) {
395395
try {
396-
fs.chownSync(entry.absolute, entry.uid, entry.gid || process.getgid())
396+
fs.chownSync(entry.absolute, entry.uid, entry.gid || this.processGid)
397397
} catch (er) {}
398398
}
399399
entry.resume()

0 commit comments

Comments
 (0)
Please sign in to comment.