< prev index next >
src/os/aix/vm/attachListener_aix.cpp
Print this page
rev 7960 : 8075506: aix: improve handling of native memory
*** 1,8 ****
/*
! * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
! * Copyright 2012, 2013 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,8 ----
/*
! * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
! * Copyright 2012, 2015 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 142,151 ****
--- 142,155 ----
_pos = arg_buffer;
_end = _pos + arg_size - 1;
}
char* next() {
if (*_pos == '\0') {
+ if (_pos < _end) {
+ _pos += 1;
+ }
+
return NULL;
}
char* res = _pos;
char* next_pos = strchr(_pos, '\0');
if (next_pos < _end) {
*** 212,221 ****
--- 216,226 ----
return -1;
}
// bind socket
struct sockaddr_un addr;
+ memset((void *)&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, initial_path);
::unlink(initial_path);
// We must call bind with the actual socketaddr length. This is obligatory for AS400.
int res = ::bind(listener, (struct sockaddr*)&addr, SUN_LEN(&addr));
< prev index next >