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

Commit 1b8e5a6b authored by The Android Open Source Project's avatar The Android Open Source Project
Browse files

auto import from //branches/cupcake/...@131421

parent 13f797da
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include <fcntl.h>
#include <errno.h>
#include <sys/socket.h>
#include <utils/logger.h>
#include <cutils/logger.h>
#include "sysdeps.h"
#include "adb.h"

+46 −0
Original line number Diff line number Diff line
/* utils/logger.h
** 
** Copyright 2007, The Android Open Source Project
**
** This file is dual licensed.  It may be redistributed and/or modified
** under the terms of the Apache 2.0 License OR version 2 of the GNU
** General Public License.
*/

#ifndef _UTILS_LOGGER_H
#define _UTILS_LOGGER_H

#include <stdint.h>

struct logger_entry {
    uint16_t    len;    /* length of the payload */
    uint16_t    __pad;  /* no matter what, we get 2 bytes of padding */
    int32_t     pid;    /* generating process's pid */
    int32_t     tid;    /* generating process's tid */
    int32_t     sec;    /* seconds since Epoch */
    int32_t     nsec;   /* nanoseconds */
    char        msg[0]; /* the entry's payload */
};

#define LOGGER_LOG_MAIN		"log/main"
#define LOGGER_LOG_RADIO	"log/radio"
#define LOGGER_LOG_EVENTS	"log/events"

#define LOGGER_ENTRY_MAX_LEN		(4*1024)
#define LOGGER_ENTRY_MAX_PAYLOAD	\
	(LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry))

#ifdef HAVE_IOCTL

#include <sys/ioctl.h>

#define __LOGGERIO	0xAE

#define LOGGER_GET_LOG_BUF_SIZE		_IO(__LOGGERIO, 1) /* size of log */
#define LOGGER_GET_LOG_LEN		_IO(__LOGGERIO, 2) /* used log len */
#define LOGGER_GET_NEXT_ENTRY_LEN	_IO(__LOGGERIO, 3) /* next entry len */
#define LOGGER_FLUSH_LOG		_IO(__LOGGERIO, 4) /* flush log */

#endif // HAVE_IOCTL

#endif /* _UTILS_LOGGER_H */
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@
#ifndef _LOGPRINT_H
#define _LOGPRINT_H

#include <utils/Log.h>
#include <utils/logger.h>
#include <cutils/log.h>
#include <cutils/logger.h>
#include <cutils/event_tag_map.h>
#include <pthread.h>

+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include <stdlib.h>
#include <stdarg.h>

#include <utils/logger.h>
#include <cutils/logger.h>
#include <cutils/logd.h>

#define LOG_BUF_SIZE	1024
+5 −0
Original line number Diff line number Diff line
@@ -170,14 +170,19 @@ int dhcp_do_request(const char *interface,
 */
int dhcp_stop(const char *interface)
{
    char result_prop_name[PROPERTY_KEY_MAX];
    const char *ctrl_prop = "ctl.stop";
    const char *desired_status = "stopped";

    snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result",
            DHCP_PROP_NAME_PREFIX,
            interface);
    /* Stop the daemon and wait until it's reported to be stopped */
    property_set(ctrl_prop, DAEMON_NAME);
    if (wait_for_property(DAEMON_PROP_NAME, desired_status, 5) < 0) {
        return -1;
    }
    property_set(result_prop_name, "failed");
    return 0;
}

Loading