From 31108f15f5d1e9cc88ff4207658bf5155b184108 Mon Sep 17 00:00:00 2001 From: Benjamin Shirley-Quirk Date: Tue, 4 Aug 2020 22:29:42 +0100 Subject: removed csize_t warnings, required casting a len to csize_t --- src/utils.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utils.nim') diff --git a/src/utils.nim b/src/utils.nim index 8ca68d4..6fb0470 100644 --- a/src/utils.nim +++ b/src/utils.nim @@ -211,7 +211,7 @@ proc forkWaitRedirect*(call: () -> int): tuple[output: seq[string], code: int] = proc getgrouplist*(user: cstring, group: Gid, groups: ptr cint, ngroups: var cint): cint {.importc, header: "".} -proc setgroups*(size: csize, groups: ptr cint): cint +proc setgroups*(size: csize_t, groups: ptr cint): cint {.importc, header: "".} proc getUser(uid: int): User = @@ -257,8 +257,8 @@ proc dropPrivileges*(): bool = if initialUser.isSome: let user = initialUser.unsafeGet var groups = user.groups.map(x => x.cint) - - if setgroups(user.groups.len, addr(groups[0])) < 0: + + if setgroups(cast[csize_t](user.groups.len), addr(groups[0])) < 0: return false if setgid((Gid) user.gid) != 0: return false -- cgit v1.2.3-70-g09d2 From 4fad58d7be80d90058cf627a2f9bccbd6016e72b Mon Sep 17 00:00:00 2001 From: Benjamin Shirley-Quirk Date: Tue, 4 Aug 2020 22:42:10 +0100 Subject: removed Exception warnings, changed Exceptions to CatchableErrors --- src/utils.nim | 4 ++-- src/wrapper/curl.nim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utils.nim') diff --git a/src/utils.nim b/src/utils.nim index 6fb0470..e46a8e0 100644 --- a/src/utils.nim +++ b/src/utils.nim @@ -2,10 +2,10 @@ import hashes, options, os, posix, sequtils, strutils, sugar, tables type - HaltError* = object of Exception + HaltError* = object of CatchableError code*: int - CommandError* = object of Exception + CommandError* = object of CatchableError color*: Option[bool] error*: bool diff --git a/src/wrapper/curl.nim b/src/wrapper/curl.nim index 79468a9..9abb341 100644 --- a/src/wrapper/curl.nim +++ b/src/wrapper/curl.nim @@ -18,7 +18,7 @@ type url = 10002, writeFunction = 20011 - CurlError* = object of Exception + CurlError* = object of CatchableError {.passL: "-lcurl".} -- cgit v1.2.3-70-g09d2