Skip to content

Commit 26ea00a

Browse files
committed
Cleanup: Correct sizeof()
1 parent 1ed7649 commit 26ea00a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rtapi/uspace_rtapi_main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ int main(int argc, char **argv) {
535535

536536
// plus one because we use the abstract namespace, it will show up in
537537
// /proc/net/unix prefixed with an @
538-
int result = ::bind(fd, (sockaddr *)&addr, len + sizeof(addr.sun_family) + 1);
538+
int result = ::bind(fd, (sockaddr *)&addr, sizeof(addr));
539539

540540
if (result == 0) {
541541
//If called in master mode with exit command, no need to start master
@@ -556,7 +556,7 @@ int main(int argc, char **argv) {
556556
gettimeofday(&t0, NULL);
557557
gettimeofday(&t1, NULL);
558558
for (int i = 0; i < 3 || (t1.tv_sec < 3 + t0.tv_sec); i++) {
559-
result = connect(fd, (sockaddr *)&addr, len + sizeof(addr.sun_family) + 1);
559+
result = connect(fd, (sockaddr *)&addr, sizeof(addr));
560560
if (result == 0)
561561
break;
562562
if (i == 0)

0 commit comments

Comments
 (0)