version 1.109, 2012/06/06 00:33:45 |
version 1.110, 2012/06/18 19:17:42 |
Line 3608 cfline(size_t linenum, const char *line, |
|
Line 3608 cfline(size_t linenum, const char *line, |
|
const char *host) |
const char *host) |
{ |
{ |
struct addrinfo hints, *res; |
struct addrinfo hints, *res; |
int error, i, pri, syncfile, flags; |
int error, i, pri, syncfile; |
const char *p, *q; |
const char *p, *q; |
char *bp; |
char *bp; |
char buf[MAXLINE]; |
char buf[MAXLINE]; |
Line 3822 cfline(size_t linenum, const char *line, |
|
Line 3822 cfline(size_t linenum, const char *line, |
|
f->f_flags |= FFLAG_SIGN; |
f->f_flags |= FFLAG_SIGN; |
#endif /* !DISABLE_SIGN */ |
#endif /* !DISABLE_SIGN */ |
(void)strlcpy(f->f_un.f_fname, p, sizeof(f->f_un.f_fname)); |
(void)strlcpy(f->f_un.f_fname, p, sizeof(f->f_un.f_fname)); |
|
if ((f->f_file = open(p, O_WRONLY|O_APPEND, 0)) < 0) { |
|
f->f_type = F_UNUSED; |
|
logerror("%s", p); |
|
break; |
|
} |
if (isatty(f->f_file)) { |
if (isatty(f->f_file)) { |
f->f_type = F_TTY; |
f->f_type = F_TTY; |
if (strcmp(p, ctty) == 0) |
if (strcmp(p, ctty) == 0) |
f->f_type = F_CONSOLE; |
f->f_type = F_CONSOLE; |
flags = O_NDELAY; |
if (fcntl(f->f_file, F_SETFL, O_NONBLOCK) == -1) |
} else { |
logerror("Warning: cannot change tty fd for" |
|
" `%s' to non-blocking.", p); |
|
} else |
f->f_type = F_FILE; |
f->f_type = F_FILE; |
flags = 0; |
|
} |
|
if ((f->f_file = open(p, O_WRONLY|O_APPEND|flags, 0)) < 0) { |
|
f->f_type = F_UNUSED; |
|
logerror("%s", p); |
|
break; |
|
} |
|
if (syncfile) |
if (syncfile) |
f->f_flags |= FFLAG_SYNC; |
f->f_flags |= FFLAG_SYNC; |
break; |
break; |