Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5827cc4b authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

Revert "libcutils: Fix aliasing violations"

This reverts commit 826d75fb.
Breaking build with 4.2

bionic/libc/include/string.h:105:33: error: call to '__memcpy_dest_size_error' declared with attribute error: memcpy called with size bigger than destination
bionic/libc/include/string.h:109:32: error: call to '__memcpy_src_size_error' declared with attribute error: memcpy called with size bigger than source

Change-Id: I777e5f5cd87fb972c833ef6bd81b23cd29878e9b
parent 39d33d8d
Loading
Loading
Loading
Loading
+3 −32
Original line number Diff line number Diff line
@@ -74,16 +74,7 @@ else
  LOCAL_SRC_FILES += fdevent.c
endif

LOCAL_CFLAGS += -g -DADB_HOST=1  -Wall -Wno-unused-parameter
# adb can't be built without optimizations, so we enforce -O2 if no
# other optimization flag is set - but we don't override what the global
# flags are saying if something else is given (-Os or -O3 are useful)
ifeq ($(findstring -O, $(HOST_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif
ifneq ($(findstring -O0, $(HOST_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif
LOCAL_CFLAGS += -O2 -g -DADB_HOST=1  -Wall -Wno-unused-parameter
LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
LOCAL_MODULE := adb

@@ -126,16 +117,7 @@ LOCAL_SRC_FILES := \
	log_service.c \
	utils.c

LOCAL_CFLAGS := -g -DADB_HOST=0 -Wall -Wno-unused-parameter
# adb can't be built without optimizations, so we enforce -O2 if no
# other optimization flag is set - but we don't override what the global
# flags are saying if something else is given (-Os or -O3 are useful)
ifeq ($(findstring -O, $(TARGET_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif
ifneq ($(findstring -O0, $(TARGET_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif
LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE

ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
@@ -182,6 +164,7 @@ LOCAL_SRC_FILES := \
	fdevent.c

LOCAL_CFLAGS := \
	-O2 \
	-g \
	-DADB_HOST=1 \
	-DADB_HOST_ON_TARGET=1 \
@@ -190,18 +173,6 @@ LOCAL_CFLAGS := \
	-D_XOPEN_SOURCE \
	-D_GNU_SOURCE

# adb can't be built without optimizations, so we enforce -O2 if no
# other optimization flag is set - but we don't override what the global
# flags are saying if something else is given (-Os or -O3 are useful)
ifeq ($(findstring -O, $(TARGET_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif
ifneq ($(findstring -O0, $(TARGET_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif

LOCAL_C_INCLUDES += external/openssl/include

LOCAL_MODULE := adb

LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils
+0 −2
Original line number Diff line number Diff line
@@ -24,9 +24,7 @@
extern "C" {
#endif

#if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__)
typedef uint16_t char16_t;
#endif

extern char * strndup16to8 (const char16_t* s, size_t n);
extern size_t strnlen16to8 (const char16_t* s, size_t n);
+4 −7
Original line number Diff line number Diff line
@@ -100,10 +100,7 @@ static int connectToServer(const char* fileName)
    int sock = -1;
    int cc;

    union {
        struct sockaddr_un un;
        struct sockaddr generic;
    } addr;
    struct sockaddr_un addr;
    
    sock = socket(AF_UNIX, SOCK_STREAM, 0);
    if (sock < 0) {
@@ -112,9 +109,9 @@ static int connectToServer(const char* fileName)
    }

    /* connect to socket; fails if file doesn't exist */
    strcpy(addr.un.sun_path, fileName);    // max 108 bytes
    addr.un.sun_family = AF_UNIX;
    cc = connect(sock, &addr.generic, SUN_LEN(&addr.un));
    strcpy(addr.sun_path, fileName);    // max 108 bytes
    addr.sun_family = AF_UNIX;
    cc = connect(sock, (struct sockaddr*) &addr, SUN_LEN(&addr));
    if (cc < 0) {
        // ENOENT means socket file doesn't exist
        // ECONNREFUSED means socket exists but nobody is listening
+5 −8
Original line number Diff line number Diff line
@@ -35,17 +35,14 @@
/* open listen() port on any interface */
int socket_inaddr_any_server(int port, int type)
{
    union {
        struct sockaddr_in in;
        struct sockaddr generic;
    } addr;
    struct sockaddr_in addr;
    size_t alen;
    int s, n;

    memset(&addr, 0, sizeof(addr));
    addr.in.sin_family = AF_INET;
    addr.in.sin_port = htons(port);
    addr.in.sin_addr.s_addr = htonl(INADDR_ANY);
    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    addr.sin_addr.s_addr = htonl(INADDR_ANY);

    s = socket(AF_INET, type, 0);
    if(s < 0) return -1;
@@ -53,7 +50,7 @@ int socket_inaddr_any_server(int port, int type)
    n = 1;
    setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n));

    if(bind(s, &addr.generic, sizeof(addr.in)) < 0) {
    if(bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
        close(s);
        return -1;
    }
+3 −6
Original line number Diff line number Diff line
@@ -124,21 +124,18 @@ error:
int socket_local_client_connect(int fd, const char *name, int namespaceId, 
        int type)
{
    union {
        struct sockaddr_un un;
        struct sockaddr generic;
    } addr;
    struct sockaddr_un addr;
    socklen_t alen;
    size_t namelen;
    int err;

    err = socket_make_sockaddr_un(name, namespaceId, &addr.un, &alen);
    err = socket_make_sockaddr_un(name, namespaceId, &addr, &alen);

    if (err < 0) {
        goto error;
    }

    if(connect(fd, &addr.generic, alen) < 0) {
    if(connect(fd, (struct sockaddr *) &addr, alen) < 0) {
        goto error;
    }

Loading