summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2009-10-22 16:51:18 +0000
committerAndrew Haley <aph@redhat.com>2009-10-22 16:51:18 +0000
commitd13376fc5a0bb0a2ee0246e76ee3319e6baf9516 (patch)
tree04e140c03b4123587b0ed0e0423480d57faf88ed
parentcca242d46d9679fe82e8457544ff2dda5c04121d (diff)
downloadclasspath-d13376fc5a0bb0a2ee0246e76ee3319e6baf9516.tar.gz
2009-10-22 Andrew Haley <aph@redhat.com>
* native/jni/native-lib/cpnet.c (cpnet_addMembership): Fix aliasing warning. (cpnet_dropMembership): Likewise. 2009-10-21 Richard Guenther <rguenther@suse.de> PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest.
-rw-r--r--ChangeLog12
-rw-r--r--native/jni/native-lib/cpnet.c6
-rw-r--r--tools/gnu/classpath/tools/jar/Creator.java11
3 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 978cff694..a89e45cd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-22 Andrew Haley <aph@redhat.com>
+
+ * native/jni/native-lib/cpnet.c (cpnet_addMembership): Fix
+ aliasing warning.
+ (cpnet_dropMembership): Likewise.
+
+2009-10-21 Richard Guenther <rguenther@suse.de>
+
+ PR cp-tools/39177
+ * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries):
+ Do not use uninitialized manifest.
+
2009-08-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/cp-hacking.texinfo (Needed Tools and Libraries): Bump
diff --git a/native/jni/native-lib/cpnet.c b/native/jni/native-lib/cpnet.c
index 044498113..154a7dd7d 100644
--- a/native/jni/native-lib/cpnet.c
+++ b/native/jni/native-lib/cpnet.c
@@ -578,9 +578,10 @@ jint cpnet_addMembership (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
{
struct ip_mreq req;
int ret;
+ struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr->data;
memset(&req, 0, sizeof(req));
- req.imr_multiaddr = ((struct sockaddr_in *)addr->data)->sin_addr;
+ req.imr_multiaddr = sockaddr->sin_addr;
req.imr_interface.s_addr = INADDR_ANY;
ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &req, sizeof(req));
if (ret != 0)
@@ -593,9 +594,10 @@ jint cpnet_dropMembership (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
{
struct ip_mreq req;
int ret;
+ struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr->data;
memset(&req, 0, sizeof(req));
- req.imr_multiaddr = ((struct sockaddr_in *)addr->data)->sin_addr;
+ req.imr_multiaddr = sockaddr->sin_addr;
req.imr_interface.s_addr = INADDR_ANY;
ret = setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &req, sizeof(req));
if (ret != 0)
diff --git a/tools/gnu/classpath/tools/jar/Creator.java b/tools/gnu/classpath/tools/jar/Creator.java
index a6b6112ca..6ffce18ac 100644
--- a/tools/gnu/classpath/tools/jar/Creator.java
+++ b/tools/gnu/classpath/tools/jar/Creator.java
@@ -216,11 +216,14 @@ public class Creator
manifest = createManifest(parameters);
/* If no version is specified, provide the same manifest version default
* as Sun's jar tool */
- Attributes attr = manifest.getMainAttributes();
- if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
- attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
- attr.putValue("Created-By", System.getProperty("java.version") +
+ if (parameters.wantManifest)
+ {
+ Attributes attr = manifest.getMainAttributes();
+ if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
+ attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
+ attr.putValue("Created-By", System.getProperty("java.version") +
" (" + System.getProperty("java.vendor") + ")");
+ }
outputStream = new JarOutputStream(os, manifest);
// FIXME: this sets the method too late for the manifest file.
outputStream.setMethod(parameters.storageMode);