Skip to content

Commit

Permalink
more thread to t renames (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Delta456 authored Aug 25, 2023
1 parent cf97591 commit 0533372
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions kernel/modules/socket/unix/unix.v
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ fn (mut this UnixSocket) connect(handle voidptr, _addr voidptr, addrlen u64) ? {
return none
}

mut thread := proc.current_thread()
mut t := proc.current_thread()

path := unsafe { cstring_to_vstring(&addr.sun_path[0]) }

C.printf(c'UNIX socket: Wants to connect to %s\n', path.str)

mut target := fs.get_node(thread.process.current_directory, path, true) or { return none }
mut target := fs.get_node(t.process.current_directory, path, true) or { return none }

target_res := target.resource

Expand Down Expand Up @@ -351,13 +351,11 @@ fn (mut this UnixSocket) bind(handle voidptr, _addr voidptr, addrlen u64) ? {
return none
}

mut thread := proc.current_thread()
mut t := proc.current_thread()

path := unsafe { cstring_to_vstring(&addr.sun_path[0]) }

mut node := fs.create(thread.process.current_directory, path, stat.ifsock) or {
return none
}
mut node := fs.create(t.process.current_directory, path, stat.ifsock) or { return none }

this.stat = node.resource.stat
node.resource = unsafe { this }
Expand Down
8 changes: 4 additions & 4 deletions kernel/modules/userland/signalfd.v
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ pub fn syscall_signalfd(_ voidptr, fdnum int, mask u64, flags int) (u64, u64) {
mut signalfd := &SignalFD(unsafe { nil })
mut newfd := int(0)

mut thread := proc.current_thread()
mut t := proc.current_thread()

thread.signalfds_lock.acquire()
t.signalfds_lock.acquire()
defer {
thread.signalfds_lock.release()
t.signalfds_lock.release()
}

if fdnum == -1 {
Expand All @@ -105,7 +105,7 @@ pub fn syscall_signalfd(_ voidptr, fdnum int, mask u64, flags int) (u64, u64) {
return errno.err, errno.get()
}

thread.signalfds << voidptr(signalfd)
t.signalfds << voidptr(signalfd)
} else {
mut fd := file.fd_from_fdnum(voidptr(0), fdnum) or { return errno.err, errno.get() }

Expand Down

0 comments on commit 0533372

Please sign in to comment.