Skip to content

Commit

Permalink
Merge pull request #127 from Chia-Network/1.2.1
Browse files Browse the repository at this point in the history
Version 1.2.1
  • Loading branch information
haorldbchi authored Oct 20, 2021
2 parents 8a585d1 + b7b637a commit 181242d
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 41 deletions.
56 changes: 43 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,27 @@
"version": "0.2.0",
"configurations": [
{
"name" : "BladeBit",
"request" : "launch",
"type" : "cppvsdbg",
"stopAtEntry": false,
"cwd" : "${workspaceFolder}",
// "console" : "externalTerminal",

"preLaunchTask": "build_debug",

"console": "internalConsole",
"name" : "Bladebit",
"type" : "cppdbg",
"request" : "launch",
"stopAtEntry" : false,
"cwd" : "${workspaceFolder}",
"console" : "internalConsole",
"preLaunchTask" : "build_debug",

"windows": {
"program": "${workspaceFolder}/build/debug/bladebit.exe"
"type" : "cppvsdbg",
"program": "${workspaceFolder}/build/Debug/bladebit.exe"
},

"linux": {
"program": "${workspaceFolder}/build/debug/bladebit"
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"program": "${workspaceFolder}/build/bladebit"
},

"osx": {
"program": "${workspaceFolder}/build/debug/bladebit"
"program": "${workspaceFolder}/build/bladebit"
},

"environment": [],
Expand All @@ -38,5 +39,34 @@
"${workspaceFolder}/.sandbox"
]
}

,{
"name" : "Bladebit Dev",

"type" : "cppdbg",
"request" : "launch",
"stopAtEntry" : false,
"cwd" : "${workspaceFolder}",
"preLaunchTask" : "build_dev_debug",
"console" : "internalConsole",

"windows": {
"type" : "cppvsdbg",
"program": "${workspaceFolder}/build/debug/bladebit_dev.exe"
},

"linux": {
"program": "${workspaceFolder}/build/bladebit_dev"
},

"osx": {
"program": "${workspaceFolder}/build/bladebit_dev"
},

"environment": [],

"args": [
]
}
]
}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@
"C_Cpp.errorSquiggles": "Enabled",
"cmake.configureOnOpen": true,
"cmake.sourceDirectory": "${workspaceFolder}/."

,"cmake.generator": "Unix Makefiles"
}
65 changes: 46 additions & 19 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,61 @@
"version": "2.0.0",
"tasks": [
{
"type" : "shell",
"label" : "build_debug",
"detail": "Build Debug BladeBit",
"type" : "shell",
"label" : "build_debug",
"detail" : "Build Debug Bladebit",
"command": "cmake",

"args": [
"--build", ".",
"--target", "bladebit",
"--config", "Debug",
"-j", "24"
],

"windows":{
},

"linux":{
"problemMatcher": [ "$gcc" ]
},

"osx":{
"problemMatcher": [ "$gcc" ]
},

"options": {
"cwd": "${workspaceFolder}/build"
},

"group": {
"kind": "build",
"isDefault": true
}
}

// Build Debug Develop
,{
"type" : "shell",
"label" : "build_dev_debug",
"detail" : "Build Develop Debug",
"command": "cmake",

"args": [
"--build", ".",
"--target", "bladebit_dev",
"--config", "Debug",
"-j", "24"
],

"windows":{
"command": "cmake",
"args": [
"--build", ".",
"--target", "bladebit",
"--config", "Debug"
]
},

"linux":{
"command": "/usr/bin/bash",
"args": [
"-c",
"make clean && make CONFIG=debug.arm -j64"
],
"problemMatcher": [ "$gcc" ]
},

"osx":{
"command": "/bin/bash",
"args": [
"-c",
"make CONFIG=debug.arm -j8"
],
"problemMatcher": [ "$gcc" ]
},

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1
2 changes: 1 addition & 1 deletion src/platform/unix/FileStream_Unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool FileStream::Open( const char* path, FileStream& file, FileMode mode, FileAc
#endif

if( mode == FileMode::Create )
fmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
fmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;

int fd = open( path, fdFlags, fmode );
if( fd < 0 )
Expand Down
14 changes: 7 additions & 7 deletions src/platform/win32/FileStream_Win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool FileStream::Open( const char* path, FileStream& file, FileMode mode, FileAc
if( access == FileAccess::None )
access = FileAccess::Read;

const DWORD dwShareMode = FILE_SHARE_READ;
const DWORD dwShareMode = 0;
const DWORD dwCreationDisposition = mode == FileMode::Create ? CREATE_ALWAYS :
mode == FileMode::Open ? OPEN_ALWAYS :
OPEN_EXISTING;
Expand Down Expand Up @@ -79,7 +79,7 @@ bool FileStream::Open( const char* path, FileStream& file, FileMode mode, FileAc
else
{
// #TODO: Use GetLastError report error in utf8
file. _error = (int)GetLastError();
file._error = (int)GetLastError();
}

if( path16 != path16Stack )
Expand Down Expand Up @@ -148,8 +148,8 @@ ssize_t FileStream::Read( void* buffer, size_t size )
_readPosition += (size_t)bytesRead;
else
{
_error = (int)GetLastError();
bytesRead = -1;
_error = (int)GetLastError();
return (ssize_t)-1;
}

return (ssize_t)bytesRead;
Expand Down Expand Up @@ -195,11 +195,11 @@ ssize_t FileStream::Write( const void* buffer, size_t size )
_writePosition += (size_t)bytesWritten;
else
{
_error = (int)GetLastError();
bytesWritten = -1;
_error = (int)GetLastError();
return (ssize_t)-1;
}

return bytesWritten;
return (ssize_t)bytesWritten;
}

//----------------------------------------------------------
Expand Down

0 comments on commit 181242d

Please sign in to comment.