comparison src/jdk.security.auth/unix/native/libjaas/Unix.c @ 51120:dccdf51b10dd

8207233: Minor improvements of jdk C-coding Reviewed-by: rriggs, prr
author goetz
date Fri, 13 Jul 2018 17:42:24 +0200
parents 71c04702a3d5
children
comparison
equal deleted inserted replaced
0:16a8f36e63ab 1:7d1cda908945
1 /* 1 /*
2 * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
62 jsize numSuppGroups; 62 jsize numSuppGroups;
63 gid_t *groups; 63 gid_t *groups;
64 jclass cls; 64 jclass cls;
65 65
66 numSuppGroups = getgroups(0, NULL); 66 numSuppGroups = getgroups(0, NULL);
67 if (numSuppGroups == -1) {
68 return;
69 }
67 groups = (gid_t *)calloc(numSuppGroups, sizeof(gid_t)); 70 groups = (gid_t *)calloc(numSuppGroups, sizeof(gid_t));
68 if (groups == NULL) { 71 if (groups == NULL) {
69 jclass cls = (*env)->FindClass(env,"java/lang/OutOfMemoryError"); 72 jclass cls = (*env)->FindClass(env,"java/lang/OutOfMemoryError");
70 if (cls != NULL) 73 if (cls != NULL)
71 (*env)->ThrowNew(env, cls, NULL); 74 (*env)->ThrowNew(env, cls, NULL);