@@ -9,10 +9,10 @@ libpseudo execution flow:
pseudo_wrappers.c: (constructor) _libpseudo_init()
pseudo_util.c: pseudo_init_util()
copy environment
- setup PSEUDO_DEBUG levels
+ setup PSEUDO_DEBUG, PSEUDO_EVLOG and PSEUDO_SEVERITY flags
pseudo_wrappers.c: pseudo_init_wrappers()
setup pseudo_functions
- setup pseudo_logfile
+ setup log files (PSEUDO_DEBUG_FILE, PSEUDO_EVLOG_FILE)
pseudo_client.c: pseudo_init_client()
setup PSEUDO_DISABLED
setup pseudo_localstate_dir_fd
@@ -100,6 +100,7 @@ extern char *pseudo_get_bindir(void);
extern char *pseudo_get_libdir(void);
extern char *pseudo_get_localstatedir(void);
extern int pseudo_debug_logfile(char *defname, int prefer_fd);
+extern int pseudo_evlog_logfile(char *defname, int prefer_fd);
extern ssize_t pseudo_sys_path_max(void);
extern ssize_t pseudo_path_max(void);
#define PSEUDO_PWD_MAX 4096
@@ -2152,8 +2152,13 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path
if (connect_fd == -1) {
pseudo_error("tried to close connection, couldn't dup: %s\n", strerror(errno));
}
- } else if (fd == pseudo_util_debug_fd) {
- pseudo_util_debug_fd = pseudo_fd(fd, COPY_FD);
+ } else if (fd == pseudo_util_debug_fd || fd == pseudo_util_evlog_fd) {
+ /* both are stderr by default */
+ int newfd = pseudo_fd(fd, COPY_FD);
+ if (fd == pseudo_util_debug_fd)
+ pseudo_util_debug_fd = newfd;
+ if (fd == pseudo_util_evlog_fd)
+ pseudo_util_evlog_fd = newfd;
} else if (fd == pseudo_localstate_dir_fd) {
pseudo_localstate_dir_fd = pseudo_fd(fd, COPY_FD);
} else if (fd == pseudo_pathlock_fd) {
@@ -1738,7 +1738,6 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
fd = newfd;
}
}
- pseudo_util_debug_fd = fd;
}
free(pseudo_path);
return fd;
@@ -183,9 +183,10 @@ pseudo_init_wrappers(void) {
pseudo_real_execv = dlsym(RTLD_NEXT, "execv");
/* Once the wrappers are setup, we can now use open... so
- * setup the logfile, if necessary...
+ * setup the logfiles, if necessary...
*/
pseudo_debug_logfile(NULL, -1);
+ pseudo_evlog_logfile(NULL, -1);
pseudo_magic();
pseudo_droplock();