diff options
author | Ken Sumrall <ksumrall@android.com> | 2013-09-18 17:49:21 -0700 |
---|---|---|
committer | Ken Sumrall <ksumrall@android.com> | 2013-09-20 17:44:33 -0700 |
commit | 4eaf905858c6a1d7cf0639bed3e8de3bd7987646 (patch) | |
tree | f787ab75ca22a15793b190de894ca13a7f73d0a5 /logwrapper/include | |
parent | 887f2892062c64fa688fc9525ebd09cc98ca70d8 (diff) | |
download | core-4eaf905858c6a1d7cf0639bed3e8de3bd7987646.tar.gz core-4eaf905858c6a1d7cf0639bed3e8de3bd7987646.tar.bz2 core-4eaf905858c6a1d7cf0639bed3e8de3bd7987646.zip |
Create a separate copy of the fsck logs
The log_target parameter of android_fork_execvp_ext() is now a
bit field, and multiple targets can be set to log to multiple
places at the same time.
The new target LOG_FILE will log to a file specified by the new
parameter file_path.
Set LOG_FILE and log to a file in /dev (the only writable filesystem
avilable when e2fsck runs) when invoking e2fsck in fs_mgr.
Bug: 10021342
Change-Id: I63baf644cc8c3afccc8345df27a74203b44d0400
Diffstat (limited to 'logwrapper/include')
-rw-r--r-- | logwrapper/include/logwrap/logwrap.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/logwrapper/include/logwrap/logwrap.h b/logwrapper/include/logwrap/logwrap.h index 8087f0a4b..4307a3055 100644 --- a/logwrapper/include/logwrap/logwrap.h +++ b/logwrapper/include/logwrap/logwrap.h @@ -44,11 +44,15 @@ __BEGIN_DECLS * send a signal twice to signal the caller (once for the child, and * once for the caller) * log_target: Specify where to log the output of the child, either LOG_NONE, - * LOG_ALOG (for the Android system log) or LOG_KLOG (for the kernel - * log). + * LOG_ALOG (for the Android system log), LOG_KLOG (for the kernel + * log), or LOG_FILE (and you need to specify a pathname in the + * file_path argument, otherwise pass NULL). These are bit fields, + * and can be OR'ed together to log to multiple places. * abbreviated: If true, capture up to the first 100 lines and last 4K of * output from the child. The abbreviated output is not dumped to * the specified log until the child has exited. + * file_path: if log_target has the LOG_FILE bit set, then this parameter + * must be set to the pathname of the file to log to. * * Return value: * 0 when logwrap successfully run the child process and captured its status @@ -58,13 +62,14 @@ __BEGIN_DECLS * */ -/* Values for the log_target parameter android_fork_exec_ext() */ +/* Values for the log_target parameter android_fork_execvp_ext() */ #define LOG_NONE 0 #define LOG_ALOG 1 #define LOG_KLOG 2 +#define LOG_FILE 4 int android_fork_execvp_ext(int argc, char* argv[], int *status, bool ignore_int_quit, - int log_target, bool abbreviated); + int log_target, bool abbreviated, char *file_path); /* Similar to above, except abbreviated logging is not available, and if logwrap * is true, logging is to the Android system log, and if false, there is no @@ -74,10 +79,9 @@ static inline int android_fork_execvp(int argc, char* argv[], int *status, bool ignore_int_quit, bool logwrap) { return android_fork_execvp_ext(argc, argv, status, ignore_int_quit, - (logwrap ? LOG_ALOG : LOG_NONE), false); + (logwrap ? LOG_ALOG : LOG_NONE), false, NULL); } - __END_DECLS #endif /* __LIBS_LOGWRAP_H */ |