extern int serverLogSyslogFacility;
extern char *serverLogSyslogTag;
#endif
-extern void FSLog(const char *format, ...);
+extern void vFSLog(const char *format, va_list args);
+/*@printflike@*/ extern void FSLog(const char *format, ...);
#define ViceLog(level, str) if ((level) <= LogLevel) (FSLog str)
+#define vViceLog(level, str) if ((level) <= LogLevel) (vFSLog str)
extern int OpenLog(const char *filename);
extern int ReOpenLog(const char *fileName);
UNLOCK_SERVERLOG();
}
-/* VARARGS1 */
-void FSLog (const char *format, ...)
+void vFSLog (const char *format, va_list args)
{
- va_list args;
-
time_t currenttime;
char *timeStamp;
char tbuffer[1024];
info += strlen(info);
}
- va_start(args, format);
(void) vsprintf(info, format, args);
- va_end(args);
len = strlen(tbuffer);
LOCK_SERVERLOG();
fflush(stderr); /* in case they're sharing the same FD */
}
#endif
-}
+} /*vFSLog*/
+
+/* VARARGS1 */
+/*@printflike@*/
+void FSLog(const char *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+ vFSLog(format, args);
+ va_end(args);
+} /*FSLog*/
static int DebugOn(int loglevel)
{
#include "partition.h"
#include "viceinode.h"
+/*@printfline@*/ extern void Log(const char *format, ...);
+
int (*vol_PollProc)() = 0; /* someone must init this */
#define ERROR_EXIT(code) {error = code; goto error_exit;}
int Statistics = 0;
-/* VARARGS */
-Log (a,b,c,d,e,f,g,h,i,j,k)
- char *a, *b, *c, *d, *e, *f, *g, *h, *i, *j, *k;
+/*@printflike@*/ void Log(const char *format, ...)
{
- int level;
+ int level;
+ va_list args;
if (Statistics)
level = -1;
else
level = 0;
- ViceLog(level,(a,b,c,d,e,f,g,h,i,j,k));
+
+ va_start(args, format);
+ vViceLog(level, (format, args));
+ va_end(args);
}
-Abort(s,a,b,c,d,e,f,g,h,i,j)
- char *s, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j;
+/*@printflike@*/ void Abort(const char *format, ...)
{
+ va_list args;
+
ViceLog(0, ("Program aborted: "));
- ViceLog(0, (s,a,b,c,d,e,f,g,h,i,j));
+ va_start(args, format);
+ vViceLog(0, (format, args));
+ va_end(args);
abort();
}
-Quit(s,a,b,c,d,e,f,g,h,i,j)
- char *s, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j;
+/*@printflike@*/ void Quit(const char *format, ...)
{
- ViceLog(0, (s,a,b,c,d,e,f,g,h,i,j));
+ va_list args;
+
+ va_start(args, format);
+ vViceLog(0, (format, args));
+ va_end(args);
exit(1);
}
#include "volume.h"
#include "partition.h"
+/*@printflike@*/ extern void Log(const char *format, ...);
+
#ifdef osi_Assert
#undef osi_Assert
#endif
#include "partition.h"
#include <afs/errors.h>
+/*@printflike@*/ extern void Log(const char *format, ...);
+
extern char *volutil_PartitionName_r(int volid, char *buf, int buflen);
int namei_iread(IHandle_t *h, int offset, char *buf, int size)
#include "salvage.h"
#include "fssync.h"
+/*@printflike@*/ extern void Log(const char *format, ...);
+
struct Lock localLock;
char *vol_DevName();
#include <jfs/filsys.h>
#endif
+/*@printflike@*/ extern void Log(const char *format, ...);
+
int aixlow_water = 8; /* default 8% */
struct DiskPartition *DiskPartitionList;
#endif /* AFS_NT40_ENV */
#include <sys/stat.h>
+extern void Abort(const char *format, ...);
+
struct VnodeClassInfo VnodeClassInfo[nVNODECLASSES];
/* Forward declarations */
-void Log(), Abort(), Exit();
+/*@printflike@*/ void Log(const char *format, ...);
+/*@printflike@*/ void Abort(const char *format, ...);
+void Exit(int code);
int Fork(void);
int Wait(char *prog);
char * ToString(char *s);
}
}
-void Log(a,b,c,d,e,f,g,h,i,j,k)
-char *a, *b, *c, *d, *e, *f, *g, *h, *i, *j, *k;
+void Log(const char *format, ...)
{
struct timeval now;
+ va_list args;
+ va_start(args, format);
#ifndef AFS_NT40_ENV
- if ( useSyslog )
- {
- syslog(LOG_INFO, a,b,c,d,e,f,g,h,i,j,k);
- } else
+ if ( useSyslog )
+ {
+ char tmp[1024];
+ (void) vsnprintf(tmp, sizeof tmp, format, args);
+ syslog(LOG_INFO, "%s", tmp);
+ } else
#endif
- {
- gettimeofday(&now, 0);
- fprintf(logFile, "%s ", TimeStamp(now.tv_sec, 1));
- fprintf(logFile, a,b,c,d,e,f,g,h,i,j,k);
- fflush(logFile);
- }
+ {
+ gettimeofday(&now, 0);
+ fprintf(logFile, "%s ", TimeStamp(now.tv_sec, 1));
+ vfprintf(logFile, format, args);
+ fflush(logFile);
+ }
+ va_end(args);
}
-void Abort(a,b,c,d,e,f,g,h,i,j,k)
-char *a, *b, *c, *d, *e, *f, *g, *h, *i, *j, *k;
+void Abort(const char *format, ...)
{
+ va_list args;
+
+ va_start(args, format);
#ifndef AFS_NT40_ENV
- if ( useSyslog )
- {
- syslog(LOG_INFO, a,b,c,d,e,f,g,h,i,j,k);
- } else
+ if ( useSyslog )
+ {
+ char tmp[1024];
+ (void) vsnprintf(tmp, sizeof tmp, format, args);
+ syslog(LOG_INFO, "%s", tmp);
+ } else
#endif
- {
- fprintf(logFile, a,b,c,d,e,f,g,h,i,j,k);
- fflush(logFile);
- if (ShowLog) showlog();
- }
+ {
+ vfprintf(logFile, format, args);
+ fflush(logFile);
+ if (ShowLog) showlog();
+ }
+ va_end(args);
+
if (debug)
abort();
Exit(1);
extern void *calloc(), *realloc();
#endif
+/*@printflike@*/ extern void Log(const char* format, ...);
+
/* Forward declarations */
static Volume *attach2();
static void FreeVolume();
#include <strings.h>
#endif
+/*@printflike@*/ extern void Log(const char *format, ...);
+
void AssignVolumeName();
void AssignVolumeName_r();
void ClearVolumeStats();
#include <afs/afsutil.h>
#include <afs/com_err.h>
-Log(a,b,c,d,e,f)
-char *a, *b, *c, *d, *e, *f;
+/*@printflike@*/ void Log(const char *format, ...)
{
- ViceLog(0, (a, b,c, d, e, f));
+ va_list args;
+
+ va_start(args, format);
+ vViceLog(0, (format, args));
+ va_end(args);
}
-LogError(errcode)
-afs_int32 errcode;
+void LogError(afs_int32 errcode)
{
ViceLog(0, ("%s: %s\n", error_table_name(errcode),error_message(errcode)));
}
-Abort(s,a,b,c,d,e,f,g,h,i,j)
-char *s;
+/*@printflike@*/ void Abort(const char* format, ...)
{
+ va_list args;
+
ViceLog(0, ("Program aborted: "));
- ViceLog(0, (s,a,b,c,d,e,f,g,h,i,j));
+ va_start(args, format);
+ vViceLog(0, (format, args));
+ va_end(args);
abort();
}
#include "volser.h"
#include "volint.h"
+/*@printflike@*/ extern void Log(const char *format, ...);
+
extern int DoLogging;
/* This iod stuff is a silly little package to emulate the old qi_in stuff, which
#include <afs/audit.h>
#include <afs/afsutil.h>
+/*@printflike@*/ extern void Log(const char* format, ...);
+/*@printflike@*/ extern void Abort(const char *format, ...);
+
#define VolserVersion "2.0"
#define N_SECURITY_OBJECTS 3
extern int (*VolFlushProc)();
extern void AFSVolExecuteRequest();
extern void RXSTATS_ExecuteRequest();
-extern Log();
struct afsconf_dir *tdir;
static afs_int32 runningCalls=0;
int DoLogging = 0;
extern struct afsconf_dir *tdir;
extern char *volutil_PartitionName();
+extern void LogError(afs_int32 errcode);
+
/* Forward declarations */
static int GetPartName(afs_int32 partid, char *pname);
#include <rx/rx.h>
#include "volser.h"
+/*@printflike@*/ extern void Log(const char *format, ...);
+
static struct volser_trans *allTrans=0;
static afs_int32 transCounter = 1;