mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
support-named-pipe-logs-20050414
so log files can be named pipes
This commit is contained in:
parent
5aab14c843
commit
bdc7e43117
@ -718,6 +718,7 @@ main(int argc, char **argv, char **envp)
|
||||
char namebuf[AFSDIR_PATH_MAX];
|
||||
#ifndef AFS_NT40_ENV
|
||||
int nofork = 0;
|
||||
struct stat sb;
|
||||
#endif
|
||||
#ifdef AFS_AIX32_ENV
|
||||
struct sigaction nsa;
|
||||
@ -863,7 +864,12 @@ main(int argc, char **argv, char **envp)
|
||||
background();
|
||||
#endif /* ! AFS_NT40_ENV */
|
||||
|
||||
if (!DoSyslog) {
|
||||
if ((!DoSyslog)
|
||||
#ifndef AFS_NT40_ENV
|
||||
&& (!(fstat(AFSDIR_BOZLOG_FILE, &sb) == 0) &&
|
||||
(S_ISFIFO(sb.st_mode)))
|
||||
#endif
|
||||
) {
|
||||
strcpy(namebuf, AFSDIR_BOZLOG_FILE);
|
||||
strcat(namebuf, ".old");
|
||||
renamefile(AFSDIR_BOZLOG_FILE, namebuf); /* try rename first */
|
||||
|
@ -44,6 +44,7 @@ RCSID
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include "afsutil.h"
|
||||
#include "fileutil.h"
|
||||
#if defined(AFS_PTHREAD_ENV)
|
||||
@ -228,10 +229,16 @@ OpenLog(const char *fileName)
|
||||
char FileName[MAXPATHLEN];
|
||||
|
||||
#ifndef AFS_NT40_ENV
|
||||
struct stat statbuf;
|
||||
|
||||
if (serverLogSyslog) {
|
||||
openlog(serverLogSyslogTag, LOG_PID, serverLogSyslogFacility);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Support named pipes as logs by not rotating them */
|
||||
if ((fstat(fileName, &statbuf) == 0) && (S_ISFIFO(statbuf.st_mode)))
|
||||
return (0);
|
||||
#endif
|
||||
|
||||
if (mrafsStyleLogs) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user