Skip to content

Commit ec36e8c

Browse files
authored
Epoll: Cleanup code to always return negative value on failure (#16591)
Motivation: We usually use a negative value in case of an error but did not in one case. While this does not really matters in practise as weput an exception on the call stack we should be consistent. Modifications: Return negative value on fcntl failure Result: More consistent code base
1 parent 1b9e868 commit ec36e8c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

transport-native-epoll/src/main/c/netty_epoll_native.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static jint netty_epoll_native_epollCreate(JNIEnv* env, jclass clazz) {
243243
int err = errno;
244244
close(efd);
245245
netty_unix_errors_throwChannelExceptionErrorNo(env, "fcntl() failed: ", err);
246-
return err;
246+
return -err;
247247
}
248248
}
249249
return efd;

0 commit comments

Comments
 (0)