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

Commit 436db2e3 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru
Browse files

merge from open-source master

parents 4b328d3b e25ff1c6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,12 @@ ifeq ($(HOST_OS),darwin)
  LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
endif

ifeq ($(HOST_OS),freebsd)
  USB_SRCS := usb_libusb.c
  EXTRA_SRCS := get_my_path_freebsd.c
  LOCAL_LDLIBS += -lpthread -lusb
endif

ifeq ($(HOST_OS),windows)
  USB_SRCS := usb_windows.c
  EXTRA_SRCS := get_my_path_windows.c
+1 −1
Original line number Diff line number Diff line
@@ -783,7 +783,7 @@ int launch_server()
        fprintf(stderr, "pipe failed in launch_server, errno: %d\n", errno);
        return -1;
    }
    get_my_path(path);
    get_my_path(path, PATH_MAX);
    pid_t pid = fork();
    if(pid < 0) return -1;

+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ void fatal_errno(const char *fmt, ...);
void handle_packet(apacket *p, atransport *t);
void send_packet(apacket *p, atransport *t);

void get_my_path(char s[PATH_MAX]);
void get_my_path(char *s, size_t maxLen);
int launch_server();
int adb_main(int is_daemon);

+2 −2
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ enum {

static int do_cmd(transport_type ttype, char* serial, char *cmd, ...);

void get_my_path(char s[PATH_MAX]);
void get_my_path(char *s, size_t maxLen);
int find_sync_dirs(const char *srcarg,
        char **android_srcdir_out, char **data_srcdir_out);
int install_app(transport_type transport, char* serial, int argc, char** argv);
@@ -673,7 +673,7 @@ static char *find_top(char path_buf[PATH_MAX])
        /* If the CWD isn't under a good-looking top, see if the
         * executable is.
         */
        get_my_path(dir);
        get_my_path(dir, PATH_MAX);
        top = find_top_from(dir, path_buf);
    }
    return top;
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#import <Carbon/Carbon.h>
#include <unistd.h>

void get_my_path(char s[PATH_MAX])
void get_my_path(char *s, size_t maxLen)
{
    ProcessSerialNumber psn;
    GetCurrentProcess(&psn);
@@ -25,6 +25,6 @@ void get_my_path(char s[PATH_MAX])
    dict = ProcessInformationCopyDictionary(&psn, 0xffffffff);
    CFStringRef value = (CFStringRef)CFDictionaryGetValue(dict,
                CFSTR("CFBundleExecutable"));
    CFStringGetCString(value, s, PATH_MAX - 1, kCFStringEncodingUTF8);
    CFStringGetCString(value, s, maxLen, kCFStringEncodingUTF8);
}
Loading