Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/sys.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-09-10 19:59:31 +0300
committerSoumith Chintala <soumith@gmail.com>2016-09-10 19:59:31 +0300
commita0c60edcad88cc65ba88a87757126b3ae0bc3e8d (patch)
tree0e336022f3ee14aa98548c25d6dc9ff3f0e68ff5
parent6de204cc2254234f8c1caa418ac36d75ee3b0488 (diff)
fixing sys to not fork for figuring out sys.OS
-rw-r--r--init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 3911ce4..bb5faf9 100644
--- a/init.lua
+++ b/init.lua
@@ -69,10 +69,11 @@ function sys.uname()
if paths.dirp('C:\\') then
return 'windows'
else
- local os = execute('uname -a')
+ local ffi = require 'ffi'
+ local os = ffi.os
if os:find('Linux') then
return 'linux'
- elseif os:find('Darwin') then
+ elseif os:find('OSX') then
return 'macos'
else
return '?'