Skip to content

Commit

Permalink
feat(libsdk): Optimized the return error code of the quota limit in t…
Browse files Browse the repository at this point in the history
…he write scenario

Signed-off-by: baijiaruo <[email protected]>
  • Loading branch information
baijiaruo1 authored and true1064 committed Jul 28, 2023
1 parent c4f929e commit 145d67b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libsdk/libsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ var (
statusEMFILE = errorToStatus(syscall.EMFILE)
statusENOTDIR = errorToStatus(syscall.ENOTDIR)
statusEISDIR = errorToStatus(syscall.EISDIR)
statusENOSPC = errorToStatus(syscall.ENOSPC)
)
var once sync.Once

Expand Down Expand Up @@ -622,6 +623,9 @@ func cfs_write(id C.int64_t, fd C.int, buf unsafe.Pointer, size C.size_t, off C.

n, err := c.write(f, int(off), buffer, flags)
if err != nil {
if err == syscall.ENOSPC {
return C.ssize_t(statusENOSPC)
}
return C.ssize_t(statusEIO)
}

Expand Down

0 comments on commit 145d67b

Please sign in to comment.