Skip to content

Commit 2ef424b

Browse files
Peter B. KesslerPeter B. Kessler
Peter B. Kessler
authored and
Peter B. Kessler
committed
[GR-10832] Mis-translation of errno = 0.
PullRequest: graal/1820
2 parents f30f2aa + 7d055bd commit 2ef424b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/PosixJavaNIOSubstitutions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,7 @@ private static byte[] getpwuid(int uid) throws Exception {
22452245
int res = 0;
22462246

22472247
// errno = 0;
2248+
Errno.set_errno(0);
22482249
// #ifdef __solaris__
22492250
// RESTARTABLE_RETURN_PTR(getpwuid_r((uid_t)uid, &pwent, pwbuf, (Unsigned)buflen),
22502251
// p);
@@ -2291,6 +2292,7 @@ private static byte[] getgrgid(int gid) throws Exception {
22912292
}
22922293

22932294
// errno = 0;
2295+
Errno.set_errno(0);
22942296
// #ifdef __solaris__
22952297
// RESTARTABLE_RETURN_PTR(getgrgid_r((gid_t)gid, &grent, grbuf, (Unsigned)buflen),
22962298
// g);
@@ -2343,6 +2345,7 @@ private static int getpwnam0(long nameAddress) throws Exception {
23432345
CCharPointer name = WordFactory.pointer(nameAddress);
23442346

23452347
// errno = 0;
2348+
Errno.set_errno(0);
23462349
// #ifdef __solaris__
23472350
// RESTARTABLE_RETURN_PTR(getpwnam_r(name, &pwent, pwbuf, (Unsigned)buflen), p);
23482351
// #else
@@ -2391,6 +2394,7 @@ private static int getgrnam0(long nameAddress) throws Exception {
23912394
}
23922395

23932396
// errno = 0;
2397+
Errno.set_errno(0);
23942398
// #ifdef __solaris__
23952399
// RESTARTABLE_RETURN_PTR(getgrnam_r(name, &grent, grbuf, (Unsigned)buflen), g);
23962400
// #else
@@ -3141,7 +3145,7 @@ static int checkConnect(FileDescriptor fdo, boolean block, boolean ready) throws
31413145
// 073 if (poller.revents) {
31423146
if (CTypeConversion.toBoolean(poller.revents())) {
31433147
// 074 errno = 0;
3144-
error_Pointer.write(0);
3148+
Errno.set_errno(0);
31453149
// 075 result = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &n);
31463150
result = Socket.getsockopt(fd, Socket.SOL_SOCKET(), Socket.SO_ERROR(), error_Pointer, n_Pointer);
31473151
// 076 if (result < 0) {

0 commit comments

Comments
 (0)