File feature-openSUSE-log-to-journal.patch of Package enlightenment
commit b7d260a14158b13087690a887d2f92954bf263ac
Author: Simon Lees <simon@simotek.net>
Date: Wed Feb 9 11:16:12 2022 +1030
Revert "e start - force stdout/err to go to specific log files"
This reverts commit 8edf2fc0a388090da74db683a690e0aed8a33eb6.
Index: enlightenment-0.27.99.20250520.6e5eabcd/src/bin/e_start_main.c
===================================================================
--- enlightenment-0.27.99.20250520.6e5eabcd.orig/src/bin/e_start_main.c
+++ enlightenment-0.27.99.20250520.6e5eabcd/src/bin/e_start_main.c
@@ -349,24 +349,6 @@ _e_ptrace_continue(int child, int back,
#endif
}
-static void
-_e_start_stdout_err_redir(const char *home)
-{
- int logfd;
- char *logf = NULL, *logf_old = NULL;
-
- // rename old olg file
- myasprintf(&logf, "%s/.e-log.log", home);
- myasprintf(&logf_old, "%s/.e-log.log.old", home);
- rename(logf, logf_old);
- // open new log file and move stdout/err to it
- logfd = open(logf, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- printf("Enlightenment: See logs in: %s\n", logf);
- if (logfd < 0) return;
- dup2(logfd, 1); // stdout to file
- dup2(logfd, 2); // stderr to file
-}
-
static int
_e_start_child(const char *home, char **args, Eina_Bool really_know, Eina_Bool trace)
{
@@ -377,7 +359,6 @@ _e_start_child(const char *home, char **
int sig = SIGTERM;
procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &sig);
#endif
- _e_start_stdout_err_redir(home);
if (trace) _e_ptrace_traceme(really_know);
execv(args[0], args);
// We failed, 0 means normal exit from E with no restart or crash so
@@ -386,7 +367,7 @@ _e_start_child(const char *home, char **
}
static Eina_Bool
-_e_ptrace_kernel_check(const char *home)
+_e_ptrace_kernel_check(void)
{
#ifdef __linux__
// Check if patch to prevent ptrace to another process is present
@@ -399,23 +380,6 @@ _e_ptrace_kernel_check(const char *home)
ret = read(fd, &c, (sizeof(c)) == sizeof(c)) && (c != '0');
close(fd);
}
- if (ret)
- {
- char *buf = NULL;
- FILE *f;
-
- myasprintf(&buf, "%s/.e-crashdump.txt", home);
- f = fopen(buf, "a");
- if (f)
- {
- fprintf(f,
- "ERROR: /proc/sys/kernel/yama/ptrace_scope is 1 disallowing remote\n"
- "attachment to a process. This means a gdb backtrace cannot be logged.\n"
- "To fix this, as root please do:\n"
- " echo 0 > /proc/sys/kernel/yama/ptrace_scope\n");
- fclose(f);
- }
- }
return ret;
#else
return EINA_FALSE;
@@ -790,7 +754,7 @@ not_done:
usleep(200000);
/* And call gdb if available */
- if (home && !_e_ptrace_kernel_check(home))
+ if (home && !_e_ptrace_kernel_check())
r = _e_call_gdb(child, home, &backtrace_str);
else
r = 0;