support-named-pipe-logs-20050414

so log files can be named pipes
This commit is contained in:
Derrick Brashear 2005-04-14 05:41:59 +00:00
parent 5aab14c843
commit bdc7e43117
2 changed files with 14 additions and 1 deletions

View File

@ -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 */

View File

@ -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) {