diff -u src/vol/clone.c src/vol/clone.c
--- src/vol/clone.c 27 May 2003 19:31:24 -0000
+++ src/vol/clone.c 29 May 2003 18:59:47 -0000
@@ -59,6 +59,8 @@
#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;}
diff -u src/vol/fssync.c src/vol/fssync.c
--- src/vol/fssync.c 27 May 2003 19:31:24 -0000
+++ src/vol/fssync.c 29 May 2003 18:59:47 -0000
@@ -82,6 +82,8 @@
#include "volume.h"
#include "partition.h"
+/*@printflike@*/ extern void Log(const char *format, ...);
+
#ifdef osi_Assert
#undef osi_Assert
#endif
diff -u src/vol/namei_ops.c src/vol/namei_ops.c
--- src/vol/namei_ops.c 27 May 2003 19:31:24 -0000
+++ src/vol/namei_ops.c 29 May 2003 18:59:47 -0000
@@ -44,6 +44,8 @@
#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)
diff -u src/vol/vnode.c src/vol/vnode.c
--- src/vol/vnode.c 27 May 2003 19:31:24 -0000
+++ src/vol/vnode.c 29 May 2003 18:59:47 -0000
@@ -63,6 +63,8 @@
#endif /* AFS_NT40_ENV */
#include <sys/stat.h>
+extern void Abort(const char *format, ...);
+
struct VnodeClassInfo VnodeClassInfo[nVNODECLASSES];
diff -u src/vol/vol-salvage.c src/vol/vol-salvage.c
--- src/vol/vol-salvage.c 27 May 2003 19:31:25 -0000
+++ src/vol/vol-salvage.c 29 May 2003 18:59:47 -0000
@@ -391,7 +391,9 @@
/* 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);
@@ -3659,39 +3661,49 @@
}
}
-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);
diff -u src/vol/volume.c src/vol/volume.c
--- src/vol/volume.c 27 May 2003 19:31:25 -0000
+++ src/vol/volume.c 29 May 2003 18:59:47 -0000
@@ -145,6 +145,8 @@
extern void *calloc(), *realloc();
#endif
+/*@printflike@*/ extern void Log(const char* format, ...);
+
/* Forward declarations */
static Volume *attach2();
static void FreeVolume();
diff -u src/vol/vutil.c src/vol/vutil.c
--- src/vol/vutil.c 27 May 2003 19:31:25 -0000
+++ src/vol/vutil.c 29 May 2003 18:59:47 -0000
@@ -64,6 +64,8 @@
#include <strings.h>
#endif
+/*@printflike@*/ extern void Log(const char *format, ...);
+
void AssignVolumeName();
void AssignVolumeName_r();
void ClearVolumeStats();
diff -u src/volser/dumpstuff.c src/volser/dumpstuff.c
--- src/volser/dumpstuff.c 27 May 2003 19:31:25 -0000
+++ src/volser/dumpstuff.c 29 May 2003 18:59:47 -0000
@@ -51,6 +51,8 @@
#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
diff -u src/volser/volprocs.c src/volser/volprocs.c
--- src/volser/volprocs.c 27 May 2003 19:31:25 -0000
+++ src/volser/volprocs.c 29 May 2003 18:59:48 -0000
@@ -71,6 +71,8 @@
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);
only in patch2:
unchanged:
--- src/util/afsutil.h 15 May 2003 16:27:59 -0000 1.14
+++ src/util/afsutil.h 29 May 2003 18:59:46 -0000
@@ -30,8 +30,10 @@
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);
only in patch2:
unchanged:
--- src/util/serverLog.c 15 May 2003 16:27:59 -0000 1.18
+++ src/util/serverLog.c 29 May 2003 18:59:46 -0000
@@ -91,11 +91,8 @@
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];
@@ -114,9 +111,7 @@
info += strlen(info);
}
- va_start(args, format);
(void) vsprintf(info, format, args);
- va_end(args);
len = strlen(tbuffer);
LOCK_SERVERLOG();
@@ -135,7 +130,18 @@
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)
{
only in patch2:
unchanged:
--- src/vol/common.c 12 Jul 2001 19:59:32 -0000 1.4
+++ src/vol/common.c 29 May 2003 18:59:47 -0000
@@ -25,30 +25,38 @@
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);
}
only in patch2:
unchanged:
--- src/vol/nuke.c 3 Mar 2003 15:10:38 -0000 1.8
+++ src/vol/nuke.c 29 May 2003 18:59:47 -0000
@@ -42,6 +42,8 @@
#include "salvage.h"
#include "fssync.h"
+/*@printflike@*/ extern void Log(const char *format, ...);
+
struct Lock localLock;
char *vol_DevName();
only in patch2:
unchanged:
--- src/vol/partition.c 28 Mar 2003 09:35:57 -0000 1.25
+++ src/vol/partition.c 29 May 2003 18:59:47 -0000
@@ -146,6 +146,8 @@
#include <jfs/filsys.h>
#endif
+/*@printflike@*/ extern void Log(const char *format, ...);
+
int aixlow_water = 8; /* default 8% */
struct DiskPartition *DiskPartitionList;
only in patch2:
unchanged:
--- src/volser/common.c 16 Oct 2002 03:59:29 -0000 1.7
+++ src/volser/common.c 29 May 2003 18:59:47 -0000
@@ -16,23 +16,28 @@
#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();
}
only in patch2:
unchanged:
--- src/volser/volmain.c 22 Aug 2002 18:45:20 -0000 1.11
+++ src/volser/volmain.c 29 May 2003 18:59:47 -0000
@@ -60,6 +60,9 @@
#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
@@ -79,7 +82,6 @@
extern int (*VolFlushProc)();
extern void AFSVolExecuteRequest();
extern void RXSTATS_ExecuteRequest();
-extern Log();
struct afsconf_dir *tdir;
static afs_int32 runningCalls=0;
int DoLogging = 0;
only in patch2:
unchanged:
--- src/volser/voltrans.c 21 Aug 2002 18:14:34 -0000 1.6
+++ src/volser/voltrans.c 29 May 2003 18:59:48 -0000
@@ -36,6 +36,8 @@
#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;