forked from public/pyceo
Always log to stderr in ceoc
The python thing will read errors from stderr, we need to log there even if it's not a tty.
This commit is contained in:
parent
e3555e5b74
commit
b348f5d5bd
|
@ -84,7 +84,7 @@ int main(int argc, char *argv[]) {
|
|||
int ret;
|
||||
|
||||
prog = xstrdup(basename(argv[0]));
|
||||
init_log(prog, LOG_PID, LOG_AUTHPRIV);
|
||||
init_log(prog, LOG_PID, LOG_AUTHPRIV, 1);
|
||||
|
||||
configure();
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ int main(int argc, char *argv[]) {
|
|||
int ret;
|
||||
|
||||
prog = xstrdup(basename(argv[0]));
|
||||
init_log(prog, LOG_PID, LOG_AUTHPRIV);
|
||||
init_log(prog, LOG_PID, LOG_AUTHPRIV, 1);
|
||||
|
||||
configure();
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ int main(int argc, char *argv[]) {
|
|||
char *op;
|
||||
|
||||
prog = xstrdup(basename(argv[0]));
|
||||
init_log(prog, LOG_PID, LOG_USER);
|
||||
init_log(prog, LOG_PID, LOG_USER, 1);
|
||||
|
||||
configure();
|
||||
setup_ops();
|
||||
|
|
|
@ -154,7 +154,7 @@ int main(int argc, char *argv[]) {
|
|||
int ret;
|
||||
|
||||
prog = xstrdup(basename(argv[0]));
|
||||
init_log(prog, LOG_PID, LOG_DAEMON);
|
||||
init_log(prog, LOG_PID, LOG_DAEMON, 0);
|
||||
|
||||
configure();
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ void cmd_adduser(void) {
|
|||
|
||||
int main(int argc, char *argv[]) {
|
||||
prog = xstrdup(basename(argv[0]));
|
||||
init_log(prog, LOG_PID, LOG_AUTHPRIV);
|
||||
init_log(prog, LOG_PID, LOG_AUTHPRIV, 0);
|
||||
|
||||
configure();
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
static int log_stderr = 1;
|
||||
|
||||
void init_log(const char *ident, int option, int facility) {
|
||||
void init_log(const char *ident, int option, int facility, int lstderr) {
|
||||
openlog(ident, option, facility);
|
||||
log_stderr = isatty(STDERR_FILENO);
|
||||
log_stderr = lstderr || isatty(STDERR_FILENO);
|
||||
}
|
||||
|
||||
static void errmsg(int prio, const char *prefix, const char *fmt, va_list args) {
|
||||
|
|
|
@ -33,7 +33,7 @@ ssize_t full_read(int fd, void *buf, size_t len);
|
|||
FILE *fopenat(DIR *d, const char *path, int flags);
|
||||
void make_env(char **envp, ...);
|
||||
void free_env(char **envp);
|
||||
void init_log(const char *ident, int option, int facility);
|
||||
void init_log(const char *ident, int option, int facility, int lstderr);
|
||||
int check_group(char *username, char *group);
|
||||
|
||||
PRINTF_LIKE(0) NORETURN void fatal(const char *, ...);
|
||||
|
|
Loading…
Reference in New Issue