]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs_snprintf is dead, long live rk_snprintf
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 24 Mar 2011 15:36:49 +0000 (15:36 +0000)
committerJeffrey Altman <jaltman@openafs.org>
Sun, 27 Mar 2011 23:43:30 +0000 (16:43 -0700)
We were shipping our own implementation of snprintf and friends, as
afs_snprintf. Now that we're using roken everywhere, we can make use
of roken's rk_snprintf, and no longer need to ship our own.

As Window's snprintf isn't C99 compliant, roken always uses its own
on this platform. The effect of this is that we can no longer use
AFS_UINT64_FMT and AFS_INT64_FMT for snprintf calls (and the Log
functions that call them). Instead, we need to always use the
Unix format specifiers when calling these functions.

Make thse changes across the whole tree.

Change-Id: I3fffef97566f239ad639f15c4decd136d5bbd765
Reviewed-on: http://gerrit.openafs.org/4316
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
39 files changed:
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_volume.c
src/WINNT/afsreg/afssw.c
src/WINNT/netidmgr_plugin/krb5common.c
src/aklog/aklog.c
src/audit/audit-sysvmq.c
src/butc/lwps.c
src/libafsauthent/Makefile.in
src/ptserver/pt_util.c
src/shlibafsauthent/Makefile.in
src/shlibafsauthent/libafsauthent.map
src/tbudb/Makefile.in
src/tptserver/Makefile.in
src/tubik/Makefile.in
src/tviced/serialize_state.c
src/tvlserver/Makefile.in
src/ubik/phys.c
src/ubik/recovery.c
src/ubik/remote.c
src/util/Makefile.in
src/util/NTMakefile
src/util/afsutil.h
src/util/serverLog.c
src/util/snprintf.c [deleted file]
src/util/test/snprintf_test.c [deleted file]
src/venus/fstrace.c
src/viced/afsfileprocs.c
src/viced/host.c
src/vol/namei_ops.c
src/vol/partition.c
src/vol/salvaged.c
src/vol/vol-info.c
src/vol/vol-salvage.c
src/vol/volume.c
src/vol/vutil.c
src/volser/restorevol.c
src/volser/vol-dump.c
src/volser/vol_split.c
src/volser/volprocs.c

index 530ad89a24df02d09c341b479e63135554984483..3ab5ef8d6c9f8e4f8cde45824497070b48199509 100644 (file)
@@ -9,10 +9,10 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
-#include <roken.h>
-
 #include <afs/stds.h>
 
+#include <roken.h>
+
 #include <windows.h>
 #include <winsock2.h>
 #include <nb30.h>
index 33576504cba5a590e87bfdeb4f3afc3efdf79d12..0f2c855541ec354fa80e38454cf7e9eaa67d5235 100644 (file)
@@ -9,10 +9,10 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
-#include <roken.h>
-
 #include <afs/stds.h>
 
+#include <roken.h>
+
 #include <windows.h>
 #include <winsock2.h>
 #include <nb30.h>
index c00ef960dc34b3f184872e3545274c50dbcf7f0b..b433253a27696425507839d06b19e476a4b2c2a7 100644 (file)
@@ -7,9 +7,12 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#include <roken.h>
+
 #include <windows.h>
 #include <shlobj.h>
 #include <stdio.h>
index 7fbaa9eef071061312df88e5cdb632dbce27dede..ba12a16a640b5c9ee684838bfc9b525b2b860e64 100644 (file)
@@ -27,6 +27,8 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
+
 #include<windows.h>
 #include<netidmgr.h>
 #include<dynimport.h>
index b724447099d44ef61675464b1475ba68a26d898c..10184b6c9bbe6a4e18817459c647b6585e1f788a 100644 (file)
@@ -42,7 +42,6 @@
 
 #include <ctype.h>
 
-#include <afs/stds.h>
 #include <afs/ktc.h>
 #include <afs/token.h>
 
@@ -885,7 +884,7 @@ rxkad_get_token(krb5_context context, struct afsconf_cell *cell, char *realm,
     } else {
        len = strlen(username)+strlen(realmUsed)+2;
        *authuser = malloc(len);
-       afs_snprintf(*authuser, len, "%s@%s", username, realmUsed);
+       snprintf(*authuser, len, "%s@%s", username, realmUsed);
        *foreign = 1;
     }
 
index 327bdda7d690d77f336e4811f30b5438f8b5a87a..01e942cb099d1760a55b31ef00b15625d5fa8ebf 100644 (file)
@@ -8,12 +8,14 @@
  */
 
 #include <afsconfig.h>
+#include <afs/param.h>
+
+#include <roken.h>
 
 /* only build on platforms that have SysV IPC support; i.e., when we
  * have sys/ipc.h */
 #ifdef HAVE_SYS_IPC_H
 
-#include <afs/param.h>
 
 #include <string.h>
 #include <stdio.h>
index d05c922748fa16ed856374fbdfdc6bc255e1d737..31c8ad0aab79b6acdb99cd6e53d38612b49da03d 100644 (file)
@@ -10,7 +10,6 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-
 #include <afs/procmgmt.h>
 #include <roken.h>
 
@@ -239,7 +238,7 @@ TapeLog(int debug, afs_int32 task, afs_int32 error1, afs_int32 error2,
     va_list ap;
 
     va_start(ap, fmt);
-    afs_vsnprintf(tmp, sizeof(tmp), fmt, ap);
+    vsnprintf(tmp, sizeof(tmp), fmt, ap);
     va_end(ap);
 
     TapeLogStr(debug, task, error1, error2, tmp);
@@ -252,7 +251,7 @@ TLog(afs_int32 task, char *fmt, ...)
     va_list ap;
 
     va_start(ap, fmt);
-    afs_vsnprintf(tmp, sizeof(tmp), fmt, ap);
+    vsnprintf(tmp, sizeof(tmp), fmt, ap);
     va_end(ap);
 
     /* Sends message to TapeLog and stdout */
@@ -287,7 +286,7 @@ ErrorLog(int debug, afs_int32 task, afs_int32 error1, afs_int32 error2,
     va_list ap;
 
     va_start(ap, fmt);
-    afs_vsnprintf(tmp, sizeof(tmp), fmt, ap);
+    vsnprintf(tmp, sizeof(tmp), fmt, ap);
     va_end(ap);
 
     ErrorLogStr(debug, task, error1, error2, tmp);
@@ -301,7 +300,7 @@ ELog(afs_int32 task, char *fmt, ...)
     va_list ap;
 
     va_start(ap, fmt);
-    afs_vsnprintf(tmp, sizeof(tmp), fmt, ap);
+    vsnprintf(tmp, sizeof(tmp), fmt, ap);
     va_end(ap);
 
     /* Sends message to ErrorLog, TapeLog and stdout */
index 82250f22834593fdf0d10fd7000fca8eb44855e0..83d971e9a6ee5d762e174a900176d7561c70d2c0 100644 (file)
@@ -63,7 +63,6 @@ UTILOBJS = \
        get_krbrlm.o \
        dirpath.o \
        serverLog.o \
-       snprintf.o \
        fileutil.o
 
 RXKADOBJS = \
@@ -204,9 +203,6 @@ dirpath.o: ${UTIL}/dirpath.c
 serverLog.o: ${UTIL}/serverLog.c
        ${AFS_CCRULE} ${UTIL}/serverLog.c
 
-snprintf.o: ${UTIL}/snprintf.c
-       ${AFS_CCRULE} ${UTIL}/snprintf.c
-
 fileutil.o: ${UTIL}/fileutil.c
        ${AFS_CCRULE} ${UTIL}/fileutil.c
 
index 9c0e0a4b91dc9292f1d734e72ff20f5e2ff9d3fb..2c52e42c4af0bef8554025fc3b75c463e6bd0a92 100644 (file)
@@ -174,7 +174,7 @@ CommandProc(struct cmd_syndesc *a_as, void *arock)
     }
 
     if (pfile == NULL) {
-        afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0", pbase);
+        snprintf(pbuffer, sizeof(pbuffer), "%s.DB0", pbase);
         pfile = pbuffer;
     }
     if ((dbase_fd = open(pfile, (wflag ? O_RDWR : O_RDONLY) | O_CREAT, 0600))
index 521bfa24f1d307ce4d2af46251f4ecdd53f315ff..480b2d18885da4f1abc81e4a75619c00fe8b92ce 100644 (file)
@@ -70,7 +70,6 @@ UTILOBJS = \
        get_krbrlm.o \
        dirpath.o \
        serverLog.o \
-       snprintf.o \
        fileutil.o
 
 RXKADOBJS = \
@@ -239,9 +238,6 @@ dirpath.o: ${UTIL}/dirpath.c
 serverLog.o: ${UTIL}/serverLog.c
        ${AFS_CCRULE} ${UTIL}/serverLog.c
 
-snprintf.o: ${UTIL}/snprintf.c
-       ${AFS_CCRULE} ${UTIL}/snprintf.c
-
 fileutil.o: ${UTIL}/fileutil.c
        ${AFS_CCRULE} ${UTIL}/fileutil.c
 
index 76f5dfcfb27e839a2821d5d40d6a9fae27f4a71c..346eac86e4bd6299c3aab3cb54208f49d7f373d2 100644 (file)
@@ -83,7 +83,6 @@
        pr_SNameToId;
        afs_get_pag_from_groups;
        setpag;
-       afs_snprintf;
        LogThreadNum;
 
     local:
index 191c2b88b6f09251e68dfcf1bc3088fb845bb8ec..0a9d3fc285351e9f7c005117e50c20b1a7183b7d 100644 (file)
@@ -23,7 +23,7 @@ BUDB=$(srcdir)/../budb
 RXOBJS= rx_pthread.o rxkad_errs.o
 
 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
-     volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
+     volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o
 
 
 INCLS=\
@@ -108,9 +108,6 @@ softsig.o: ${UTIL}/softsig.c
 hostparse.o: ${UTIL}/hostparse.c
        $(AFS_CCRULE) $(UTIL)/hostparse.c
 
-snprintf.o: ${UTIL}/snprintf.c
-       $(AFS_CCRULE) $(UTIL)/snprintf.c
-
 pthread_glock.o: ${UTIL}/pthread_glock.c
        $(AFS_CCRULE) $(UTIL)/pthread_glock.c
 
index 0871a6558d9e52ab24983530adc4a96017bf8423..8ea190aa9f5392a6c703bd813e537953b6615a15 100644 (file)
@@ -23,7 +23,7 @@ PTSERVER=$(srcdir)/../ptserver
 RXOBJS= rx_pthread.o rxkad_errs.o
 
 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
-     volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
+     volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o
 
 INCLS=${TOP_INCDIR}/ubik.h \
        ${TOP_INCDIR}/lock.h  \
@@ -95,9 +95,6 @@ softsig.o: ${UTIL}/softsig.c
 hostparse.o: ${UTIL}/hostparse.c
        $(AFS_CCRULE) $(UTIL)/hostparse.c
 
-snprintf.o: ${UTIL}/snprintf.c
-       $(AFS_CCRULE) $(UTIL)/snprintf.c
-
 pthread_glock.o: ${UTIL}/pthread_glock.c
        $(AFS_CCRULE) $(UTIL)/pthread_glock.c
 
index 7ba412fbb61ba7626dd1ff6433d18ce7a38505ff..462a4e55673983ed473f7a9da2c54b102385c86e 100644 (file)
@@ -30,8 +30,7 @@ INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
 RXOBJS = rx_pthread.o
 
 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
-       volparse.o flipbase64.o softsig.o hostparse.o snprintf.o \
-       pthread_glock.o
+       volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o
 
 LIBS=${RXOBJS} ${UTILOBJS} ${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a \
      ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
@@ -88,9 +87,6 @@ softsig.o: ${UTIL}/softsig.c
 hostparse.o: ${UTIL}/hostparse.c
        $(AFS_CCRULE) $(UTIL)/hostparse.c
 
-snprintf.o: ${UTIL}/snprintf.c
-       $(AFS_CCRULE) $(UTIL)/snprintf.c
-
 pthread_glock.o: ${UTIL}/pthread_glock.c
        $(AFS_CCRULE) $(UTIL)/pthread_glock.c
 
index b2b30117aab3aa40af4d0ed033cd5399cf900dfa..8c104a5e4b13f13404d9ce0a0b77a86328c6b930 100644 (file)
@@ -329,7 +329,7 @@ fs_stateCreateDump(struct fs_dump_state * state)
     char savedump[MAXPATHLEN];
     struct afs_stat status;
 
-    afs_snprintf(savedump, sizeof(savedump), "%s.old", state->fn);
+    snprintf(savedump, sizeof(savedump), "%s.old", state->fn);
 
     if (afs_stat(state->fn, &status) == 0) {
        renamefile(state->fn, savedump);
index 362cd38d96712474deec387724b8634085279091..91a95ae2e8ab32242d3297b094ce5bc50cce1af3 100644 (file)
@@ -23,8 +23,8 @@ VLSERVER=$(srcdir)/../vlserver
 RXOBJS= rx_pthread.o rxkad_errs.o
 
 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
-     volparse.o flipbase64.o softsig.o hostparse.o snprintf.o \
-     pthread_glock.o get_krbrlm.o
+     volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o \
+     get_krbrlm.o
 
 INCLS=${TOP_INCDIR}/ubik.h \
              ${TOP_INCDIR}/lwp.h \
@@ -92,9 +92,6 @@ softsig.o: ${UTIL}/softsig.c
 hostparse.o: ${UTIL}/hostparse.c
        $(AFS_CCRULE) $(UTIL)/hostparse.c
 
-snprintf.o: ${UTIL}/snprintf.c
-       $(AFS_CCRULE) $(UTIL)/snprintf.c
-
 pthread_glock.o: ${UTIL}/pthread_glock.c
        $(AFS_CCRULE) $(UTIL)/pthread_glock.c
 
index 5ef33bee0228c7833337be241de44b70d10ec791..d763632395f64b804c026fa5750710ee43e6191e 100644 (file)
@@ -89,8 +89,8 @@ uphys_open(struct ubik_dbase *adbase, afs_int32 afid)
     }
 
     /* not found, open it and try to enter in cache */
-    afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d", adbase->pathName,
-                (afid<0)?"SYS":"", (afid<0)?-afid:afid);
+    snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d", adbase->pathName,
+            (afid<0)?"SYS":"", (afid<0)?-afid:afid);
     fd = open(pbuffer, O_CREAT | O_RDWR, 0600);
     if (fd < 0) {
        /* try opening read-only */
index 2b3cc76259771974e826aa0ed595064f8a3c7d58..aa221b0d3b32252f4889a4c376295c0b6f198aad 100644 (file)
@@ -603,7 +603,9 @@ urecovery_Interact(void *dummy)
                ubik_dprint("setlabel io error=%d\n", code);
                goto FetchEndCall;
            }
-           afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+           snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP",
+                    ubik_dbase->pathName, (file<0)?"SYS":"",
+                    (file<0)?-file:file);
            fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
            if (fd < 0) {
                code = errno;
@@ -652,13 +654,19 @@ urecovery_Interact(void *dummy)
                urecovery_state |= UBIK_RECHAVEDB;
                memcpy(&ubik_dbase->version, &tversion,
                       sizeof(struct ubik_version));
-               afs_snprintf(tbuffer, sizeof(tbuffer), "%s.DB%s%d", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+               snprintf(tbuffer, sizeof(tbuffer), "%s.DB%s%d",
+                        ubik_dbase->pathName, (file<0)?"SYS":"",
+                        (file<0)?-file:file);
 #ifdef AFS_NT40_ENV
-               afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+               snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD",
+                        ubik_dbase->pathName, (file<0)?"SYS":"",
+                        (file<0)?-file:file);
                code = unlink(pbuffer);
                if (!code)
                    code = rename(tbuffer, pbuffer);
-               afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+               snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP",
+                        ubik_dbase->pathName, (file<0)?"SYS":"",
+                        (file<0)?-file:file);
 #endif
                if (!code)
                    code = rename(pbuffer, tbuffer);
@@ -670,7 +678,9 @@ urecovery_Interact(void *dummy)
                                                 &ubik_dbase->version);
                }
 #ifdef AFS_NT40_ENV
-               afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+               snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD",
+                        ubik_dbase->pathName, (file<0)?"SYS":"",
+                        (file<0)?-file:file);
                unlink(pbuffer);
 #endif
            }
index 4a0d706d3ef0f1f0a447cd1e5ce16b34a22fe165..1bde0360a5cfb32306ef132cc1a5109335fdab1d 100644 (file)
@@ -501,7 +501,9 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file,
     offset = 0;
     epoch = tversion.epoch = 0;                /* start off by labelling in-transit db as invalid */
     (*dbase->setlabel) (dbase, file, &tversion);       /* setlabel does sync */
-    afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+    snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP",
+            ubik_dbase->pathName, (file<0)?"SYS":"",
+            (file<0)?-file:file);
     fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
     if (fd < 0) {
        code = errno;
@@ -544,13 +546,16 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file,
 
     /* sync data first, then write label and resync (resync done by setlabel call).
      * This way, good label is only on good database. */
-    afs_snprintf(tbuffer, sizeof(tbuffer), "%s.DB%s%d", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+    snprintf(tbuffer, sizeof(tbuffer), "%s.DB%s%d",
+            ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
 #ifdef AFS_NT40_ENV
-    afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+    snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD",
+            ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
     code = unlink(pbuffer);
     if (!code)
        code = rename(tbuffer, pbuffer);
-    afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+    snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP",
+            ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
 #endif
     if (!code)
        code = rename(pbuffer, tbuffer);
@@ -559,7 +564,8 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file,
        code = (*ubik_dbase->setlabel) (dbase, file, avers);
     }
 #ifdef AFS_NT40_ENV
-    afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
+    snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.OLD",
+            ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file);
     unlink(pbuffer);
 #endif
     memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
index 660f48930395fd63258ed0d804f67d7d10b905b8..82a8d2d099c4c5ba68919cc112155e3a935cb776 100644 (file)
@@ -20,8 +20,8 @@ objects = assert.o base64.o casestrcpy.o config_file.o ktime.o volparse.o \
         hostparse.o exec.o \
         hputil.o kreltime.o get_krbrlm.o uuid.o serverLog.o \
         dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
-        afs_atomlist.o afs_lhash.o snprintf.o pthread_glock.o \
-        tabular_output.o ${REGEX_OBJ}
+        afs_atomlist.o afs_lhash.o pthread_glock.o tabular_output.o \
+        ${REGEX_OBJ}
 
 objects_pic = \
        assert_pic.o \
@@ -44,7 +44,6 @@ objects_pic = \
        fstab_pic.o \
        afs_atomlist_pic.o \
        afs_lhash_pic.o \
-       snprintf_pic.o \
        pthread_glock_pic.o \
        tabular_output_pic.o \
        ${REGEX_OBJ_PIC}
@@ -261,9 +260,6 @@ afs_atomlist_pic.o: ${srcdir}/afs_atomlist.c ${includes}
 afs_lhash_pic.o: ${srcdir}/afs_lhash.c ${includes}
        $(SHD_CCRULE) ${srcdir}/afs_lhash.c
 
-snprintf_pic.o: ${srcdir}/snprintf.c ${includes}
-       $(SHD_CCRULE) ${srcdir}/snprintf.c
-
 pthread_glock_pic.o: ${srcdir}/pthread_glock.c ${includes}
        $(SHD_CCRULE) ${srcdir}/pthread_glock.c
 
@@ -353,4 +349,4 @@ check-splint:
            assert.c base64.c casestrcpy.c ktime.c volparse.c hostparse.c \
            hputil.c kreltime.c get_krbrlm.c uuid.c serverLog.c \
            dirpath.c fileutil.c netutils.c flipbase64.c \
-           afs_atomlist.c afs_lhash.c snprintf.c fstab.c
+           afs_atomlist.c afs_lhash.c fstab.c
index 99014424d1d848c220de63e3154838b86df1a6f6..514fb226de830146279f7385000c39e1fd254c65 100644 (file)
@@ -55,7 +55,6 @@ LIBOBJS = \
        $(OUT)\regex.obj \
        $(OUT)\readdir_nt.obj \
        $(OUT)\serverLog.obj \
-       $(OUT)\snprintf.obj \
        $(OUT)\uuid.obj \
        $(OUT)\volparse.obj \
        $(OUT)\winsock_nt.obj \
@@ -77,7 +76,6 @@ MT_LIBOBJS = \
        $(OUT)\regex.obj \
        $(OUT)\readdir_nt.obj \
        $(OUT)\serverLog_mt.obj \
-       $(OUT)\snprintf.obj \
        $(OUT)\uuid.obj \
        $(OUT)\volparse.obj \
        $(OUT)\winsock_nt.obj \
index b56015e89da1ac8cbad0cf0bfb0f2ed57a3d4bc9..6a0651080aaa8f016e7a3c7abb0da7bcc64cce54 100644 (file)
@@ -55,35 +55,6 @@ extern int OpenLog(const char *filename);
 extern int ReOpenLog(const char *fileName);
 extern void SetupLogSignals(void);
 
-extern int
-afs_vsnprintf( /*@out@ */ char *p, size_t avail, const char *fmt,
-             va_list ap)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 3, 0)
-    /*@requires maxSet(p) >= (avail-1)@ */
-    /*@modifies p@ */ ;
-
-extern /*@printflike@ */ int
-afs_snprintf( /*@out@ */ char *p, size_t avail, const char *fmt, ...)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 3, 4)
-    /*@requires maxSet(p) >= (avail-1)@ */
-    /*@modifies p@ */ ;
-
-extern int
-afs_vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 3, 0);
-
-extern int
-afs_vasprintf (char **ret, const char *format, va_list args)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 2, 0);
-
-extern int
-afs_asprintf (char **ret, const char *format, ...)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 2, 3);
-
-extern int
-afs_asnprintf (char **ret, size_t max_sz, const char *format, ...)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 3, 4);
-
 /* special version of ctime that clobbers a *different static variable, so
  * that ViceLog can call ctime and not cause buffer confusion.
  */
index 65a245642a91fe1b616aab26882a8f87278b3fd5..06c8db2f67a703acfafa61df1a95cc74630a8deb 100644 (file)
@@ -114,14 +114,13 @@ vFSLog(const char *format, va_list args)
     if (mrafsStyleLogs || threadIdLogs) {
        num = (*threadNumProgram) ();
         if (num > -1) {
-       (void)afs_snprintf(info, (sizeof tbuffer) - strlen(tbuffer), "[%d] ",
-                          num);
-       info += strlen(info);
-    }
+           snprintf(info, (sizeof tbuffer) - strlen(tbuffer), "[%d] ",
+                    num);
+           info += strlen(info);
+       }
     }
 
-    (void)afs_vsnprintf(info, (sizeof tbuffer) - strlen(tbuffer), format,
-                       args);
+    vsnprintf(info, (sizeof tbuffer) - strlen(tbuffer), format, args);
 
     len = strlen(tbuffer);
     LOCK_SERVERLOG();
@@ -302,11 +301,11 @@ OpenLog(const char *fileName)
                strcpy((char *)&ourName, (char *)fileName);
        }
     makefilename:
-       afs_snprintf(FileName, MAXPATHLEN, "%s.%d%02d%02d%02d%02d%02d",
-                    ourName, TimeFields->tm_year + 1900,
-                    TimeFields->tm_mon + 1, TimeFields->tm_mday,
-                    TimeFields->tm_hour, TimeFields->tm_min,
-                    TimeFields->tm_sec);
+       snprintf(FileName, MAXPATHLEN, "%s.%d%02d%02d%02d%02d%02d",
+                ourName, TimeFields->tm_year + 1900,
+                TimeFields->tm_mon + 1, TimeFields->tm_mday,
+                TimeFields->tm_hour, TimeFields->tm_min,
+                TimeFields->tm_sec);
        if(lstat(FileName, &buf) == 0) {
            /* avoid clobbering a log */
            TimeFields->tm_sec++;
diff --git a/src/util/snprintf.c b/src/util/snprintf.c
deleted file mode 100644 (file)
index 1f79105..0000000
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
- * Copyright (c) 1997 - 2004 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* snprintf.c - Formatted, length-limited print to a string */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#include <roken.h>
-#include <ctype.h>
-
-/* This is an enhanced version of the *printf functionality shipped
- * with Heimdal.  In addition to the standard Unix formatting types
- * this version also supports Microsoft's I32 and I64 type modifiers
- * and the OpenAFS I type which is used to generate output from
- * network byte order IPv4 addresses (either dotted notation or
- * hostname lookups.  Implementation details follow:
- *
- *   - Actually obeys the length limit, which (unfortunately) many
- *     implementations of snprintf do not.
- *
- *   - Supports all the standard format specifiers for integers
- *     (d, i, o, u, x, X), floating-point values (f, e, E, g, G),
- *     and strings and characters (c, s, %), plus a few unusual
- *     but useful ones described below.
- *
- *   - The Microsoft integral size modifiers I32 and I64 are
- *     supported.  I32 is equivalent to 'l'.
- *     I64 is equivalent to 'll'.
- *
- *   - Supports all the standard flags (-, 0, +, space, #).  These
- *     flags are ignored if used when they are not appropriate.
- *
- *   - Supports the standard size modifiers for short (h), long (h),
- *     and double (L) arguments.  These modifiers are ignored if used
- *     when they are not appropriate.
- *
- *   - Supports minimum field width and precision, where appropriate,
- *     including the use of '*' to specify a value given as an argument
- *     instead of in the format string.  There is a maximum precision
- *     of 100 digits.
- *
- *   - The 'p' specifier for printing pointers is implemented using
- *     intptr_t (C99-standard).
- *
- *   - Floating-point specifier (%e, %f, %g) are implemented by
- *     calling the standard sprintf, and thus may be unsafe.
- *
- *   - The '%...$' notation is used primarily when the format string
- *     is specified by the user, who knows but cannot change the order
- *     of the arguments.  Such usage is inherently dangerous and
- *     insecure; thus, it is not supported.
- *
- *   - Passing in a format and an NULL buffer is supported.  This
- *     will compute the size of the buffer required by the format
- *     and the provided input parameters.
- *
- * The custom format specifier '%I' is supported.  This specifier
- * takes as its argument an unsigned long integer containing an
- * IPv4 address in network byte order.  The address is rendered
- * either as a hostname or as a dotted quad, as follows:
- *
- *   - If precision is nonzero or unspecified, a hostname lookup
- *     is attempted; if it is successful, the hostname is printed.
- *     If the hostname lookup fails, the address is printed in
- *     dotted-quad notation.
- *
- *   - If precision is explicitly specified as 0, then the hostname
- *     lookup is skipped, and dotted-quad notation is always used.
- *
- *   - If a hostname is to be printed:
- *     + The precision controls the maximum number of characters
- *       printed, as with %s.
- *     + If the '#' flag is specified, any letters in the hostname
- *       will be forced to lower case before printing.
- *     + If the '+' flag is specified, any letters in the hostname
- *       will be forced to upper case before printing.  If both
- *       '#' and '+' are given, the '+' flag will be ignored.
- *     + The '0' and ' ' flags have no effect.
- *
- *   - If a dotted quad is to be printed:
- *     + The precision has no effect; dotted quads are always
- *       7 to 12 characters in length, depending on the value
- *       to be printed and the format flags used.
- *     + If the '0' flag is given, each field (byte) of the address
- *       will be padded with '0' on the left to three digits.
- *     + If the ' ' flag is given, each field (byte) of the address
- *       will be padded with spaces on the left to three digits.  If
- *       both '0' and ' ' are given, the ' ' flag will be ignored.
- *     + The '#' and '+' flags have no effect.
- *
- * A test program exists in src/util/tests/snprintf_tests.c.
- */
-
-#define MAXPREC 100
-
-enum format_flags {
-    minus_flag     =  1,
-    plus_flag      =  2,
-    space_flag     =  4,
-    alternate_flag =  8,
-    zero_flag      = 16
-};
-
-/*
- * Common state
- */
-
-struct snprintf_state {
-    unsigned char *str;
-    unsigned char *s;
-    unsigned char *theend;
-    size_t sz;
-    size_t max_sz;
-    void (*append_char)(struct snprintf_state *, unsigned char);
-    /* XXX - methods */
-};
-
-static int
-afs_sn_reserve (struct snprintf_state *state, size_t n)
-{
-    return state->s + n > state->theend;
-}
-
-static void
-afs_sn_append_char (struct snprintf_state *state, unsigned char c)
-{
-    if (!afs_sn_reserve (state, 1))
-       *state->s++ = c;
-}
-
-static int
-as_reserve (struct snprintf_state *state, size_t n)
-{
-    if (state->s + n > state->theend) {
-       size_t off = state->s - state->str;
-       unsigned char *tmp;
-
-       if (state->max_sz && state->sz >= state->max_sz)
-           return 1;
-
-       state->sz = max(state->sz * 2, state->sz + n);
-       if (state->max_sz)
-           state->sz = min(state->sz, state->max_sz);
-       tmp = (unsigned char *)realloc (state->str, state->sz);
-       if (tmp == NULL)
-           return 1;
-       state->str = tmp;
-       state->s = state->str + off;
-       state->theend = state->str + state->sz - 1;
-    }
-    return 0;
-}
-
-static void
-as_append_char (struct snprintf_state *state, unsigned char c)
-{
-    if(!as_reserve (state, 1))
-       *state->s++ = c;
-}
-
-static int
-pad(struct snprintf_state *state, int width, char c)
-{
-    int len = 0;
-    while(width-- > 0){
-       (*state->append_char)(state,  c);
-       ++len;
-    }
-    return len;
-}
-
-/* return true if we should use alternatve hex form */
-static int
-use_alternative (int flags, afs_uint64 num, unsigned base)
-{
-    return (flags & alternate_flag) && base == 16 && num != 0;
-}
-
-static int
-append_number(struct snprintf_state *state,
-             afs_uint64 num, unsigned base, const char *rep,
-             int width, int prec, int flags, int minusp)
-{
-    int len = 0;
-    afs_uint64 n = num;
-    char nstr[MAXPREC]; /* enough for <192 bit octal integers */
-    int nstart, nlen;
-    char signchar;
-
-    /* given precision, ignore zero flag */
-    if(prec != -1)
-       flags &= ~zero_flag;
-    else
-       prec = 1;
-
-    /* format number as string */
-    nstart = sizeof(nstr);
-    nlen = 0;
-    nstr[--nstart] = '\0';
-
-    do {
-       nstr[--nstart] = rep[n % base];
-       ++nlen;
-       n /= base;
-    } while(n);
-
-    /* zero value with zero precision should produce no digits */
-    if(prec == 0 && num == 0) {
-       nlen--;
-       nstart++;
-    }
-
-    /* figure out what char to use for sign */
-    if(minusp)
-       signchar = '-';
-    else if((flags & plus_flag))
-       signchar = '+';
-    else if((flags & space_flag))
-       signchar = ' ';
-    else
-       signchar = '\0';
-
-    if((flags & alternate_flag) && base == 8) {
-       /* if necessary, increase the precision to
-          make first digit a zero */
-
-       /* XXX C99 claims (regarding # and %o) that "if the value and
-           precision are both 0, a single 0 is printed", but there is
-           no such wording for %x. This would mean that %#.o would
-           output "0", but %#.x "". This does not make sense, and is
-           also not what other printf implementations are doing. */
-
-       if(prec <= nlen && nstr[nstart] != '0' && nstr[nstart] != '\0')
-           prec = nlen + 1;
-    }
-
-    /* possible formats:
-       pad | sign | alt | zero | digits
-       sign | alt | zero | digits | pad   minus_flag
-       sign | alt | zero | digits zero_flag */
-
-    /* if not right justifying or padding with zeros, we need to
-       compute the length of the rest of the string, and then pad with
-       spaces */
-    if(!(flags & (minus_flag | zero_flag))) {
-       if(prec > nlen)
-           width -= prec;
-       else
-           width -= nlen;
-
-       if(use_alternative(flags, num, base))
-           width -= 2;
-
-       if(signchar != '\0')
-           width--;
-
-       /* pad to width */
-       len += pad(state, width, ' ');
-    }
-    if(signchar != '\0') {
-       (*state->append_char)(state, signchar);
-       ++len;
-    }
-    if(use_alternative(flags, num, base)) {
-       (*state->append_char)(state, '0');
-       (*state->append_char)(state, rep[10] + 23); /* XXX */
-       len += 2;
-    }
-    if(flags & zero_flag) {
-       /* pad to width with zeros */
-       if(prec - nlen > width - len - nlen)
-           len += pad(state, prec - nlen, '0');
-       else
-           len += pad(state, width - len - nlen, '0');
-    } else
-       /* pad to prec with zeros */
-       len += pad(state, prec - nlen, '0');
-
-    while(nstr[nstart] != '\0') {
-       (*state->append_char)(state, nstr[nstart++]);
-       ++len;
-    }
-
-    if(flags & minus_flag)
-       len += pad(state, width - len, ' ');
-
-    return len;
-}
-
-/*
- * return length
- */
-
-static int
-append_string (struct snprintf_state *state,
-              const unsigned char *arg,
-              int width,
-              int prec,
-              int flags)
-{
-    int len = 0;
-
-    if(arg == NULL)
-       arg = (const unsigned char*)"(null)";
-
-    if(prec != -1)
-       width -= prec;
-    else
-       width -= (int)strlen((const char *)arg);
-    if(!(flags & minus_flag))
-       len += pad(state, width, ' ');
-
-    if (prec != -1) {
-       while (*arg && prec--) {
-           (*state->append_char) (state, *arg++);
-           ++len;
-       }
-    } else {
-       while (*arg) {
-           (*state->append_char) (state, *arg++);
-           ++len;
-       }
-    }
-    if(flags & minus_flag)
-       len += pad(state, width, ' ');
-    return len;
-}
-
-static int
-append_char(struct snprintf_state *state,
-           unsigned char arg,
-           int width,
-           int flags)
-{
-    int len = 0;
-
-    while(!(flags & minus_flag) && --width > 0) {
-       (*state->append_char) (state, ' ')    ;
-       ++len;
-    }
-    (*state->append_char) (state, arg);
-    ++len;
-    while((flags & minus_flag) && --width > 0) {
-       (*state->append_char) (state, ' ');
-       ++len;
-    }
-    return 0;
-}
-
-#define MAXPREC 100
-static int
-append_float(struct snprintf_state *state,
-             char type,
-             double arg,
-             int width,
-             int prec,
-             int flags)
-{
-    int len = 0;
-    char fbuf[20], xbuf[MAXPREC + 21];
-
-    sprintf(fbuf, "%%%s%s.*L%c",
-            (flags & plus_flag) ? "+" : ((flags & space_flag) ? " " : ((flags & minus_flag) ? "-" : "")),
-            (flags & alternate_flag) ? "#" : "", type);
-    if (prec == -1)
-        prec = 6;
-    if (prec > MAXPREC)
-       prec = MAXPREC;
-    sprintf(xbuf, fbuf, prec, arg);
-
-    len = append_string(state, (unsigned char *)xbuf, width, -1, 0);
-    return len;
-}
-
-static int
-append_address(struct snprintf_state *state,
-               afs_uint32 arg,
-               int width,
-               int prec,
-               int flags)
-{
-    int len = 0;
-    struct hostent * he;
-    struct in_addr ia;
-    char * x, *y;
-
-    /* IP address:
-     * value is provided as a network-order unsigned long integer
-     * precision specifies max hostname length, as for %s
-     * if precision is explicitly 0, no hostname lookup is done
-     * if 0fill specified, IPaddr fields are 0-filled to 3 digits
-     * if spsign specified, IPaddr fields are space-filled to 3 digits
-     */
-    ia.s_addr = arg;
-    if (prec == 0)
-        he = 0;
-    else
-        he = gethostbyaddr((char *)&ia, 4, AF_INET);
-    if (he) {
-        x = he->h_name;
-        len = (int)strlen(x);
-        if (prec != -1 && prec < len)
-            width = prec;
-        else
-            width = len;
-        if (flags & alternate_flag) {
-            for (y = x; *y; y++)
-                if (isupper(*y))
-                    *y = tolower(*y);
-        } else if (flags & plus_flag) {
-            for (y = x; *y; y++)
-                if (islower(*y))
-                    *y = toupper(*y);
-        }
-        len = append_string(state, (unsigned char *)x, width, prec, 0);
-    } else {
-        char xbuf[16];
-        arg = ntohl(arg);
-        if (flags & zero_flag) {
-            x = "%03u.%03u.%03u.%03u";
-        } else if (flags & space_flag) {
-            x = "%3u.%3u.%3u.%3u";
-        } else {
-            x = "%u.%u.%u.%u";
-        }
-        /* typecast to whatever '%u' is! */
-        sprintf(xbuf, x, (unsigned int)((arg & 0xff000000) >> 24),
-                         (unsigned int)((arg & 0x00ff0000) >> 16),
-                         (unsigned int)((arg & 0x0000ff00) >> 8),
-                         (unsigned int)(arg & 0x000000ff));
-        len = append_string(state, (unsigned char *)xbuf, 0, -1, 0);
-    }
-
-    return len;
-}
-
-/*
- * This can't be made into a function...
- */
-
-#if defined(AFS_NT40_ENV)
-
-#define PARSE_INT_FORMAT(res, arg, unsig) \
-if (long_long_flag) \
-     res = (unsig __int64)va_arg(arg, unsig __int64); \
-else if (long_flag || addr_flag) \
-     res = (unsig long)va_arg(arg, unsig long); \
-else if (size_t_flag) \
-     res = (size_t)va_arg(arg, size_t); \
-else if (short_flag) \
-     res = (unsig short)va_arg(arg, unsig int); \
-else \
-     res = (unsig int)va_arg(arg, unsig int)
-
-#else /* AFS_NT40_ENV */
-
-#define PARSE_INT_FORMAT(res, arg, unsig) \
-if (long_long_flag) \
-     res = (unsig long long)va_arg(arg, unsig long long); \
-else if (long_flag || addr_flag) \
-     res = (unsig long)va_arg(arg, unsig long); \
-else if (size_t_flag) \
-     res = (size_t)va_arg(arg, size_t); \
-else if (short_flag) \
-     res = (unsig short)va_arg(arg, unsig int); \
-else \
-     res = (unsig int)va_arg(arg, unsig int)
-#endif
-
-
-/*
- * zyxprintf - return length, as snprintf
- */
-
-static int
-xyzprintf (struct snprintf_state *state, const char *char_format, va_list ap)
-{
-    const unsigned char *format = (const unsigned char *)char_format;
-    unsigned char c;
-    int len = 0;
-
-    while((c = *format++)) {
-       if (c == '%') {
-           int flags          = 0;
-           int width          = 0;
-           int prec           = -1;
-           int size_t_flag    = 0;
-           int long_long_flag = 0;
-           int long_flag      = 0;
-           int short_flag     = 0;
-            int addr_flag      = 0;
-
-           /* flags */
-           while((c = *format++)){
-               if(c == '-')
-                   flags |= minus_flag;
-               else if(c == '+')
-                   flags |= plus_flag;
-               else if(c == ' ')
-                   flags |= space_flag;
-               else if(c == '#')
-                   flags |= alternate_flag;
-               else if(c == '0')
-                   flags |= zero_flag;
-               else if(c == '\'')
-                   ; /* just ignore */
-               else
-                   break;
-           }
-
-           if((flags & space_flag) && (flags & plus_flag))
-               flags ^= space_flag;
-
-           if((flags & minus_flag) && (flags & zero_flag))
-               flags ^= zero_flag;
-
-           /* width */
-           if (isdigit(c))
-               do {
-                   width = width * 10 + c - '0';
-                   c = *format++;
-               } while(isdigit(c));
-           else if(c == '*') {
-               width = va_arg(ap, int);
-               c = *format++;
-           }
-
-           /* precision */
-           if (c == '.') {
-               prec = 0;
-               c = *format++;
-               if (isdigit(c))
-                   do {
-                       prec = prec * 10 + c - '0';
-                       c = *format++;
-                   } while(isdigit(c));
-               else if (c == '*') {
-                   prec = va_arg(ap, int);
-                   c = *format++;
-               }
-           }
-
-           /* size */
-
-           if (c == 'h') {
-               short_flag = 1;
-               c = *format++;
-           } else if (c == 'z') {
-               size_t_flag = 1;
-               c = *format++;
-           } else if (c == 'l') {
-               long_flag = 1;
-               c = *format++;
-               if (c == 'l') {
-                   long_long_flag = 1;
-                   c = *format++;
-               }
-           } else if (c == 'I') {
-                /* This could be either Microsoft I{32,64} notation */
-                c = *format++;
-                if (c == '3') {
-                    long_flag = 1;
-                    c = *format++;
-                    if (c == '2') {
-                        c = *format++;
-                    }
-                } else if (c == '6') {
-                    long_flag = 1;
-                    c = *format++;
-                    if (c == '4') {
-                        long_long_flag = 1;
-                        c = *format++;
-                    }
-                } else {
-                    /* Or the OpenAFS special %I meaning network address */
-                    addr_flag = 1;
-                    --format;
-                    c = 'I';
-                }
-            } else if (c == 'p') {
-                flags |= zero_flag;
-                if (prec == -1)
-                    prec = 2 * sizeof(void *);
-                if (sizeof(void *) == sizeof(afs_uint64))
-                    long_long_flag = 1;
-                else if (sizeof(void *) == sizeof(afs_uint32))
-                    long_flag = 1;
-                else
-                    long_flag = 1;
-            }
-
-           if(c != 'd' && c != 'i' && c != 'I')
-               flags &= ~(plus_flag | space_flag);
-
-           switch (c) {
-           case 'c' :
-               append_char(state, va_arg(ap, int), width, flags);
-               ++len;
-               break;
-           case 's' :
-               len += append_string(state,
-                                    va_arg(ap, unsigned char*),
-                                    width,
-                                    prec,
-                                    flags);
-               break;
-           case 'd' :
-           case 'i' : {
-               afs_int64 arg;
-               afs_uint64 num;
-               int minusp = 0;
-
-               PARSE_INT_FORMAT(arg, ap, signed);
-
-               if (arg < 0) {
-                   minusp = 1;
-                   num = -arg;
-               } else
-                   num = arg;
-
-               len += append_number (state, num, 10, "0123456789",
-                                     width, prec, flags, minusp);
-               break;
-           }
-           case 'u' : {
-               afs_uint64 arg;
-
-               PARSE_INT_FORMAT(arg, ap, unsigned);
-
-               len += append_number (state, arg, 10, "0123456789",
-                                     width, prec, flags, 0);
-               break;
-           }
-           case 'o' : {
-               afs_uint64 arg;
-
-               PARSE_INT_FORMAT(arg, ap, unsigned);
-
-               len += append_number (state, arg, 010, "01234567",
-                                     width, prec, flags, 0);
-               break;
-           }
-           case 'x' : {
-               afs_uint64 arg;
-
-               PARSE_INT_FORMAT(arg, ap, unsigned);
-
-               len += append_number (state, arg, 0x10, "0123456789abcdef",
-                                     width, prec, flags, 0);
-               break;
-           }
-           case 'X' :{
-               afs_uint64 arg;
-
-               PARSE_INT_FORMAT(arg, ap, unsigned);
-
-               len += append_number (state, arg, 0x10, "0123456789ABCDEF",
-                                     width, prec, flags, 0);
-               break;
-           }
-           case 'p' : {
-               afs_uint64 arg = (intptr_t)va_arg(ap, void*);
-               len += append_number (state, arg, 0x10, "0123456789ABCDEF",
-                                     width, prec, flags, 0);
-               break;
-           }
-           case 'n' : {
-               int *arg = va_arg(ap, int*);
-               *arg = (int)(state->s - state->str);
-               break;
-           }
-            case 'I' : {
-                afs_uint64 arg;
-
-                PARSE_INT_FORMAT(arg, ap, unsigned);
-
-                len += append_address (state, (unsigned long)arg, width, prec, flags);
-                break;
-            }
-            case 'e':
-            case 'E':
-            case 'f':
-            case 'g':
-            case 'G': {
-                double arg = (double)va_arg(ap, double);
-
-                len += append_float (state, c, arg, width, prec, flags);
-                break;
-            }
-           case '\0' :
-               --format;
-               /* FALLTHROUGH */
-           case '%' :
-               (*state->append_char)(state, c);
-               ++len;
-               break;
-           default :
-               (*state->append_char)(state, '%');
-               (*state->append_char)(state, c);
-               len += 2;
-               break;
-           }
-       } else {
-           (*state->append_char) (state, c);
-           ++len;
-       }
-    }
-    return len;
-}
-
-
-int
-afs_vsnprintf (char *str, size_t sz, const char *format, va_list args)
-{
-    struct snprintf_state state;
-    int ret;
-    unsigned char *ustr = (unsigned char *)str;
-
-    state.max_sz = 0;
-    state.sz     = sz;
-    state.str    = ustr;
-    state.s      = ustr;
-    state.theend = ustr + sz - (sz > 0);
-    state.append_char = afs_sn_append_char;
-
-    ret = xyzprintf (&state, format, args);
-    if (state.s != NULL && sz != 0)
-       *state.s = '\0';
-    return ret;
-}
-
-int
-afs_snprintf (char *str, size_t sz, const char *format, ...)
-{
-    va_list args;
-    int ret;
-
-    va_start(args, format);
-    ret = afs_vsnprintf (str, sz, format, args);
-    va_end(args);
-
-#ifdef PARANOIA
-    {
-       int ret2;
-       unsigned char *tmp;
-
-       tmp = (unsigned char *)malloc (sz);
-       if (tmp == NULL)
-           abort ();
-
-       va_start(args, format);
-       ret2 = afs_vsprintf (tmp, format, args);
-       va_end(args);
-       if (ret != ret2 || strcmp(str, tmp))
-           abort ();
-       free (tmp);
-    }
-#endif
-
-    return ret;
-}
-
-int
-afs_vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
-{
-    int st;
-    struct snprintf_state state;
-
-    state.max_sz = max_sz;
-    state.sz     = 1;
-    state.str    = (unsigned char *)malloc(state.sz);
-    if (state.str == NULL) {
-       *ret = NULL;
-       return -1;
-    }
-    state.s = state.str;
-    state.theend = state.s + state.sz - 1;
-    state.append_char = as_append_char;
-
-    st = xyzprintf (&state, format, args);
-    if (st > state.sz) {
-       free (state.str);
-       *ret = NULL;
-       return -1;
-    } else {
-       char *tmp;
-
-       *state.s = '\0';
-       tmp = (char *)realloc (state.str, st+1);
-       if (tmp == NULL) {
-           free (state.str);
-           *ret = NULL;
-           return -1;
-       }
-       *ret = tmp;
-       return st;
-    }
-}
-
-int
-afs_vasprintf (char **ret, const char *format, va_list args)
-{
-    return afs_vasnprintf (ret, 0, format, args);
-}
-
-int
-afs_asprintf (char **ret, const char *format, ...)
-{
-    va_list args;
-    int val;
-
-    va_start(args, format);
-    val = afs_vasprintf (ret, format, args);
-    va_end(args);
-
-#ifdef PARANOIA
-    {
-       int ret2;
-       unsigned char *tmp;
-       tmp = (unsigned char *)malloc (val + 1);
-       if (tmp == NULL)
-           abort ();
-
-       va_start(args, format);
-       ret2 = afs_vsprintf (tmp, format, args);
-       va_end(args);
-       if (val != ret2 || strcmp(*ret, tmp))
-           abort ();
-       free (tmp);
-    }
-#endif
-
-    return val;
-}
-
-int
-afs_asnprintf (char **ret, size_t max_sz, const char *format, ...)
-{
-    va_list args;
-    int val;
-
-    va_start(args, format);
-    val = afs_vasnprintf (ret, max_sz, format, args);
-
-#ifdef PARANOIA
-    {
-       int ret2;
-       unsigned char *tmp;
-       tmp = (unsigned char *)malloc (val + 1);
-       if (tmp == NULL)
-           abort ();
-
-       ret2 = afs_vsprintf (tmp, format, args);
-       if (val != ret2 || strcmp(*ret, tmp))
-           abort ();
-       free (tmp);
-    }
-#endif
-
-    va_end(args);
-    return val;
-}
-
-
-#ifndef AFS_NT40_ENV
-#ifndef HAVE_VSYSLOG
-void
-vsyslog(int priority, const char *format, va_list args)
-{
-  char buf[1024];
-  afs_vsnprintf(buf, sizeof(buf), format, args);
-  syslog(priority, "%s", buf);
-}
-#endif
-#endif
diff --git a/src/util/test/snprintf_test.c b/src/util/test/snprintf_test.c
deleted file mode 100644 (file)
index 753f341..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of KTH nor the names of its contributors may be
- *    used to endorse or promote products derived from this software without
- *    specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <afs/stds.h>
-#include <afs/afsutil.h>
-#include <limits.h>
-
-static int
-try (const char *format, ...)
-{
-    int ret;
-    va_list ap;
-    char buf1[256], buf2[256];
-
-    va_start (ap, format);
-    ret = afs_vsnprintf (buf1, sizeof(buf1), format, ap);
-    if (ret >= sizeof(buf1)) {
-       fprintf(stderr, "increase buf and try again\n");
-        exit(1);
-    }
-    va_end (ap);
-    va_start (ap, format);
-    vsprintf (buf2, format, ap);
-    ret = strcmp (buf1, buf2);
-    if (ret)
-       printf ("failed: format = \"%s\", \"%s\" != \"%s\"\n",
-               format, buf1, buf2);
-    va_end (ap);
-    return ret;
-}
-
-static int
-cmp_with_sprintf_int (void)
-{
-    int tot = 0;
-    int int_values[] = {INT_MIN, -17, -1, 0, 1, 17, 4711, 65535, INT_MAX};
-    int i;
-
-    for (i = 0; i < sizeof(int_values) / sizeof(int_values[0]); ++i) {
-       tot += try ("%d", int_values[i]);
-       tot += try ("%x", int_values[i]);
-       tot += try ("%X", int_values[i]);
-       tot += try ("%o", int_values[i]);
-       tot += try ("%#x", int_values[i]);
-       tot += try ("%#X", int_values[i]);
-       tot += try ("%#o", int_values[i]);
-       tot += try ("%10d", int_values[i]);
-       tot += try ("%10x", int_values[i]);
-       tot += try ("%10X", int_values[i]);
-       tot += try ("%10o", int_values[i]);
-       tot += try ("%#10x", int_values[i]);
-       tot += try ("%#10X", int_values[i]);
-       tot += try ("%#10o", int_values[i]);
-       tot += try ("%-10d", int_values[i]);
-       tot += try ("%-10x", int_values[i]);
-       tot += try ("%-10X", int_values[i]);
-       tot += try ("%-10o", int_values[i]);
-       tot += try ("%-#10x", int_values[i]);
-       tot += try ("%-#10X", int_values[i]);
-       tot += try ("%-#10o", int_values[i]);
-    }
-    return tot;
-}
-
-static int
-cmp_with_sprintf_long (void)
-{
-    int tot = 0;
-    long long_values[] = {LONG_MIN, -17, -1, 0, 1, 17, 4711, 65535, LONG_MAX};
-    int i;
-
-    for (i = 0; i < sizeof(long_values) / sizeof(long_values[0]); ++i) {
-       tot += try ("%ld", long_values[i]);
-       tot += try ("%lx", long_values[i]);
-       tot += try ("%lX", long_values[i]);
-       tot += try ("%lo", long_values[i]);
-       tot += try ("%#lx", long_values[i]);
-       tot += try ("%#lX", long_values[i]);
-       tot += try ("%#lo", long_values[i]);
-       tot += try ("%10ld", long_values[i]);
-       tot += try ("%10lx", long_values[i]);
-       tot += try ("%10lX", long_values[i]);
-       tot += try ("%10lo", long_values[i]);
-       tot += try ("%#10lx", long_values[i]);
-       tot += try ("%#10lX", long_values[i]);
-       tot += try ("%#10lo", long_values[i]);
-       tot += try ("%-10ld", long_values[i]);
-       tot += try ("%-10lx", long_values[i]);
-       tot += try ("%-10lX", long_values[i]);
-       tot += try ("%-10lo", long_values[i]);
-       tot += try ("%-#10lx", long_values[i]);
-       tot += try ("%-#10lX", long_values[i]);
-       tot += try ("%-#10lo", long_values[i]);
-    }
-    return tot;
-}
-
-#ifdef HAVE_LONG_LONG
-
-/* XXX doesn't work as expected on lp64 platforms with sizeof(long
- * long) == sizeof(long) */
-
-static int
-cmp_with_sprintf_long_long (void)
-{
-    int tot = 0;
-    long long long_long_values[] = {
-       ((long long)LONG_MIN) -1, LONG_MIN, -17, -1,
-       0,
-       1, 17, 4711, 65535, LONG_MAX, ((long long)LONG_MAX) + 1};
-    int i;
-
-    for (i = 0; i < sizeof(long_long_values) / sizeof(long_long_values[0]); ++i) {
-       tot += try ("%lld", long_long_values[i]);
-       tot += try ("%llx", long_long_values[i]);
-       tot += try ("%llX", long_long_values[i]);
-       tot += try ("%llo", long_long_values[i]);
-       tot += try ("%#llx", long_long_values[i]);
-       tot += try ("%#llX", long_long_values[i]);
-       tot += try ("%#llo", long_long_values[i]);
-       tot += try ("%10lld", long_long_values[i]);
-       tot += try ("%10llx", long_long_values[i]);
-       tot += try ("%10llX", long_long_values[i]);
-       tot += try ("%10llo", long_long_values[i]);
-       tot += try ("%#10llx", long_long_values[i]);
-       tot += try ("%#10llX", long_long_values[i]);
-       tot += try ("%#10llo", long_long_values[i]);
-       tot += try ("%-10lld", long_long_values[i]);
-       tot += try ("%-10llx", long_long_values[i]);
-       tot += try ("%-10llX", long_long_values[i]);
-       tot += try ("%-10llo", long_long_values[i]);
-       tot += try ("%-#10llx", long_long_values[i]);
-       tot += try ("%-#10llX", long_long_values[i]);
-       tot += try ("%-#10llo", long_long_values[i]);
-    }
-    return tot;
-}
-
-#endif
-
-#if defined(AFS_NT40_ENV)
-
-static int
-cmp_with_sprintf_I64 (void)
-{
-    int tot = 0;
-    __int64 int64_values[] = {
-       ((__int64)LONG_MIN) -1, LONG_MIN, -17, -1,
-       0,
-       1, 17, 4711, 65535, LONG_MAX, ((__int64)LONG_MAX) + 1};
-    int i;
-
-    for (i = 0; i < sizeof(int64_values) / sizeof(int64_values[0]); ++i) {
-       tot += try ("%I64d", int64_values[i]);
-       tot += try ("%I64x", int64_values[i]);
-       tot += try ("%I64X", int64_values[i]);
-       tot += try ("%I64o", int64_values[i]);
-       tot += try ("%#I64x", int64_values[i]);
-       tot += try ("%#I64X", int64_values[i]);
-       tot += try ("%#I64o", int64_values[i]);
-       tot += try ("%10I64d", int64_values[i]);
-       tot += try ("%10I64x", int64_values[i]);
-       tot += try ("%10I64X", int64_values[i]);
-       tot += try ("%10I64o", int64_values[i]);
-       tot += try ("%#10I64x", int64_values[i]);
-       tot += try ("%#10I64X", int64_values[i]);
-       tot += try ("%#10I64o", int64_values[i]);
-       tot += try ("%-10I64d", int64_values[i]);
-       tot += try ("%-10I64x", int64_values[i]);
-       tot += try ("%-10I64X", int64_values[i]);
-       tot += try ("%-10I64o", int64_values[i]);
-       tot += try ("%-#10I64x", int64_values[i]);
-       tot += try ("%-#10I64X", int64_values[i]);
-       tot += try ("%-#10I64o", int64_values[i]);
-    }
-    return tot;
-}
-
-#endif
-
-static int
-cmp_with_sprintf_float (void)
-{
-    int tot = 0;
-    double double_values[] = {-99999, -999, -17.4, -4.3, -3.0, -1.5, -1,
-                             0, 0.1, 0.2342374852, 0.2340007,
-                             3.1415926, 14.7845, 34.24758, 9999, 9999999};
-    int i;
-
-    for (i = 0; i < sizeof(double_values) / sizeof(double_values[0]); ++i) {
-       tot += try ("%f", double_values[i]);
-       tot += try ("%10f", double_values[i]);
-       tot += try ("%.2f", double_values[i]);
-       tot += try ("%7.0f", double_values[i]);
-       tot += try ("%5.2f", double_values[i]);
-       tot += try ("%0f", double_values[i]);
-       tot += try ("%#f", double_values[i]);
-       tot += try ("%e", double_values[i]);
-       tot += try ("%10e", double_values[i]);
-       tot += try ("%.2e", double_values[i]);
-       tot += try ("%7.0e", double_values[i]);
-       tot += try ("%5.2e", double_values[i]);
-       tot += try ("%0e", double_values[i]);
-       tot += try ("%#e", double_values[i]);
-       tot += try ("%E", double_values[i]);
-       tot += try ("%10E", double_values[i]);
-       tot += try ("%.2E", double_values[i]);
-       tot += try ("%7.0E", double_values[i]);
-       tot += try ("%5.2E", double_values[i]);
-       tot += try ("%0E", double_values[i]);
-       tot += try ("%#E", double_values[i]);
-       tot += try ("%g", double_values[i]);
-       tot += try ("%10g", double_values[i]);
-       tot += try ("%.2g", double_values[i]);
-       tot += try ("%7.0g", double_values[i]);
-       tot += try ("%5.2g", double_values[i]);
-       tot += try ("%0g", double_values[i]);
-       tot += try ("%#g", double_values[i]);
-       tot += try ("%G", double_values[i]);
-       tot += try ("%10G", double_values[i]);
-       tot += try ("%.2G", double_values[i]);
-       tot += try ("%7.0G", double_values[i]);
-       tot += try ("%5.2G", double_values[i]);
-       tot += try ("%0G", double_values[i]);
-       tot += try ("%#G", double_values[i]);
-    }
-    return tot;
-}
-
-static int
-test_null (void)
-{
-    return afs_snprintf (NULL, 0, "foo") != 3;
-}
-
-static int
-test_sizet (void)
-{
-    int tot = 0;
-    size_t sizet_values[] = { 0, 1, 2, 200, 4294967295u
-#ifdef _WIN64
-                              ,0xffffffffffffffffui64
-#endif
-    }; /* SIZE_MAX */
-    char *result[] = { "0", "1", "2", "200", "4294967295"
-#ifdef _WIN64
-                       ,"18446744073709551615"
-#endif
-    };
-    int i;
-
-    for (i = 0; i < sizeof(sizet_values) / sizeof(sizet_values[0]); ++i) {
-#if 0
-       tot += try("%zu", sizet_values[i]);
-       tot += try("%zx", sizet_values[i]);
-       tot += try("%zX", sizet_values[i]);
-#else
-       char buf[256];
-       afs_snprintf(buf, sizeof(buf), "%zu", sizet_values[i]);
-       if (strcmp(buf, result[i]) != 0) {
-           printf("%s != %s", buf, result[i]);
-           tot++;
-       }
-#endif
-    }
-    return tot;
-}
-
-static int
-test_ptr (void)
-{
-    int tot = 0;
-    void * ptr;
-
-    if (sizeof(ptr) == 4) {
-        ptr = (void *)0x12345678;
-        tot += try ("%p", ptr);
-        tot += try ("%#p", ptr);
-        tot += try ("%4p", ptr);
-        tot += try ("%#4p", ptr);
-        tot += try ("%-4p", ptr);
-        tot += try ("%-#4p", ptr);
-    } else if (sizeof(ptr) == 8) {
-        ptr = (void *)0x0102030405060708;
-        tot += try ("%p", ptr);
-        tot += try ("%#p", ptr);
-        tot += try ("%8p", ptr);
-        tot += try ("%#8p", ptr);
-        tot += try ("%-8p", ptr);
-        tot += try ("%-#8p", ptr);
-    }
-
-
-    return tot;
-}
-
-static int 
-test_ipaddr (void)
-{
-    int tot = 0;
-    struct hostent * he = gethostbyname("www.openafs.org");
-    char buf[256];
-    unsigned long addr;
-
-    if (!he) {
-        fprintf(stderr, "gethostbyname failure\n");
-        tot = 1;
-    }
-    addr = *((unsigned long *)he->h_addr);
-    afs_snprintf(buf, sizeof(buf), "%I", addr);
-    if (strcmp(buf, "OPENAFS.ORG")) {
-        fprintf(stderr, "%s != %s\n", buf, "OPENAFS.ORG");
-        tot++;
-    }
-    afs_snprintf(buf, sizeof(buf), "%+I", addr);
-    if (strcmp(buf, "OPENAFS.ORG")) {
-        fprintf(stderr, "%s != %s\n", buf, "OPENAFS.ORG");
-        tot++;
-    }
-    afs_snprintf(buf, sizeof(buf), "%#I", addr);
-    if (strcmp(buf, "openafs.org")) {
-        fprintf(stderr, "%s != %s\n", buf, "openafs.org");
-        tot++;
-    }
-    afs_snprintf(buf, sizeof(buf), "%.7I", addr);
-    if (strcmp(buf, "OPENAFS")) {
-        fprintf(stderr, "%s != %s\n", buf, "OPENAFS");
-        tot++;
-    }
-    afs_snprintf(buf, sizeof(buf), "%.0I", addr);
-    if (strcmp(buf, "128.2.200.90")) {
-        fprintf(stderr, "%s != %s\n", buf, "128.2.200.90");
-        tot++;
-    }
-    afs_snprintf(buf, sizeof(buf), "%0.0I", addr);
-    if (strcmp(buf, "128.002.200.090")) {
-        fprintf(stderr, "%s != %s\n", buf, "128.002.200.090");
-        tot++;
-    }
-    afs_snprintf(buf, sizeof(buf), "% .0I", addr);
-    if (strcmp(buf, "128.  2.200. 90")) {
-        fprintf(stderr, "%s != %s\n", buf, "128.  2.200. 90");
-        tot++;
-    }
-
-    return tot;
-}
-
-
-int
-main (int argc, char **argv)
-{
-    int ret = 0;
-
-#ifdef AFS_NT40_ENV
-    afs_winsockInit();
-#endif
-
-    ret += cmp_with_sprintf_int ();
-    ret += cmp_with_sprintf_long ();
-#ifdef HAVE_LONG_LONG
-    ret += cmp_with_sprintf_long_long ();
-#endif
-#if defined(AFS_NT40_ENV)
-    ret += cmp_with_sprintf_I64 ();
-#endif
-    ret += cmp_with_sprintf_float ();
-    ret += test_null ();
-    ret += test_sizet ();
-    ret += test_ptr ();
-    ret += test_ipaddr ();
-
-#ifdef AFS_NT40_ENV
-    afs_winsockCleanup();
-#endif
-    
-    return ret;
-}
index b677431c400c8b327ba7dd411dc04f93aafd1e56..3cb5bfa6011858766681f9992803ec6c5119fa07 100644 (file)
@@ -13,6 +13,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -622,8 +623,8 @@ dce1_error_inq_text(afs_uint32 status_to_convert,
      * install this special message catalog in with internationalization
      * catalogs.
      */
-    afs_snprintf(nls_filename, sizeof(nls_filename), "%s/C/%s.cat",
-                AFSDIR_CLIENT_DATA_DIRPATH, filename_prefix);
+    snprintf(nls_filename, sizeof(nls_filename), "%s/C/%s.cat",
+            AFSDIR_CLIENT_DATA_DIRPATH, filename_prefix);
 
     catd = catopen(nls_filename, 0);
     if (catd == (nl_catd) -1) {
index a8f9975ab5be8495064d9fd0bbc0859827f66be6..2349c0415e59717a3df3c30615f7f89f71211e12 100644 (file)
@@ -326,8 +326,7 @@ CheckLength(struct Volume *vp, struct Vnode *vnp, afs_sfsize_t alen)
     if (alen != vlen) {
        afs_int64 alen64 = alen, vlen64 = vlen;
        ViceLog(0, ("Fid %lu.%lu.%lu has inconsistent length (index "
-                   "%" AFS_INT64_FMT ", inode %" AFS_INT64_FMT "); volume "
-                   "must be salvaged\n",
+                   "%lld inode %lld ); volume must be salvaged\n",
                    afs_printable_uint32_lu(vp->hashid),
                    afs_printable_uint32_lu(Vn_id(vnp)),
                    afs_printable_uint32_lu(vnp->disk.uniquifier),
@@ -1821,7 +1820,7 @@ Alloc_NewVnode(Vnode * parentptr, DirHandle * dir, Volume * volptr,
         AdjustDiskUsage(volptr, BlocksPreallocatedForVnode,
                         BlocksPreallocatedForVnode))) {
        ViceLog(25,
-               ("Insufficient space to allocate %" AFS_INT64_FMT " blocks\n",
+               ("Insufficient space to allocate %lld blocks\n",
                 (afs_intmax_t) BlocksPreallocatedForVnode));
        return (errorCode);
     }
index 211383aba30c22ed52644f33416baace2e903995..ae5b008c241e3d9099b3cb05829c82974c1c01d1 100644 (file)
@@ -2749,34 +2749,30 @@ h_PrintClient(struct host *host, int flags, void *rock)
        H_UNLOCK;
        return flags;
     }
-    (void)afs_snprintf(tmpStr, sizeof tmpStr,
-                      "Host %s:%d down = %d, LastCall %s",
-                      afs_inet_ntoa_r(host->host, hoststr),
-                      ntohs(host->port), (host->hostFlags & VENUSDOWN),
-                      afs_ctime(&LastCall, tbuffer,
-                                sizeof(tbuffer)));
+    snprintf(tmpStr, sizeof tmpStr, "Host %s:%d down = %d, LastCall %s",
+            afs_inet_ntoa_r(host->host, hoststr),
+            ntohs(host->port), (host->hostFlags & VENUSDOWN),
+            afs_ctime(&LastCall, tbuffer, sizeof(tbuffer)));
     (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
     for (client = host->FirstClient; client; client = client->next) {
        if (!client->deleted) {
-               expTime = client->expTime;
-               (void)afs_snprintf(tmpStr, sizeof tmpStr,
-                                  "    user id=%d,  name=%s, sl=%s till %s",
-                                  client->ViceId, h_UserName(client),
-                                  client->
-                                  authClass ? "Authenticated" :
-                                  "Not authenticated",
-                                  client->
-                                  authClass ? afs_ctime(&expTime, tbuffer,
-                                                        sizeof(tbuffer))
-                                  : "No Limit\n");
-               (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
-           (void)afs_snprintf(tmpStr, sizeof tmpStr, "      CPS-%d is [",
-                              client->CPS.prlist_len);
+           expTime = client->expTime;
+           snprintf(tmpStr, sizeof tmpStr,
+                    "    user id=%d,  name=%s, sl=%s till %s",
+                    client->ViceId, h_UserName(client),
+                    client->authClass ? "Authenticated"
+                                      : "Not authenticated",
+                    client->authClass ? afs_ctime(&expTime, tbuffer,
+                                                  sizeof(tbuffer))
+                                      : "No Limit\n");
+           (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+           snprintf(tmpStr, sizeof tmpStr, "      CPS-%d is [",
+                        client->CPS.prlist_len);
            (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
            if (client->CPS.prlist_val) {
                for (i = 0; i < client->CPS.prlist_len; i++) {
-                   (void)afs_snprintf(tmpStr, sizeof tmpStr, " %d",
-                                      client->CPS.prlist_val[i]);
+                   snprintf(tmpStr, sizeof tmpStr, " %d",
+                            client->CPS.prlist_val[i]);
                    (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
                }
            }
@@ -2811,8 +2807,8 @@ h_PrintClients(void)
        return;
     }
     now = FT_ApproxTime();
-    (void)afs_snprintf(tmpStr, sizeof tmpStr, "List of active users at %s\n",
-                      afs_ctime(&now, tbuffer, sizeof(tbuffer)));
+    snprintf(tmpStr, sizeof tmpStr, "List of active users at %s\n",
+            afs_ctime(&now, tbuffer, sizeof(tbuffer)));
     (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
     h_Enumerate(h_PrintClient, (char *)file);
     STREAM_REALLYCLOSE(file);
@@ -2832,19 +2828,20 @@ h_DumpHost(struct host *host, int flags, void *rock)
     char hoststr[16];
 
     H_LOCK;
-    (void)afs_snprintf(tmpStr, sizeof tmpStr,
-                      "ip:%s port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [",
-                      afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port), host->index,
-                      host->cblist, CheckLock(&host->lock), host->LastCall,
-                      host->ActiveCall, (host->hostFlags & VENUSDOWN),
-                      host->hostFlags & HOSTDELETED, host->Console,
-                      host->hostFlags & CLIENTDELETED, host->hcpsfailed,
-                      host->cpsCall);
+    snprintf(tmpStr, sizeof tmpStr,
+            "ip:%s port:%d hidx:%d cbid:%d lock:%x last:%u active:%u "
+            "down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u "
+            "hcps [",
+            afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port),
+            host->index, host->cblist, CheckLock(&host->lock),
+            host->LastCall, host->ActiveCall, (host->hostFlags & VENUSDOWN),
+            host->hostFlags & HOSTDELETED, host->Console,
+            host->hostFlags & CLIENTDELETED, host->hcpsfailed,
+            host->cpsCall);
     (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
     if (host->hcps.prlist_val)
        for (i = 0; i < host->hcps.prlist_len; i++) {
-           (void)afs_snprintf(tmpStr, sizeof tmpStr, " %d",
-                              host->hcps.prlist_val[i]);
+           snprintf(tmpStr, sizeof tmpStr, " %d", host->hcps.prlist_val[i]);
            (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
        }
     sprintf(tmpStr, "] [");
@@ -2881,8 +2878,8 @@ h_DumpHosts(void)
        return;
     }
     now = FT_ApproxTime();
-    (void)afs_snprintf(tmpStr, sizeof tmpStr, "List of active hosts at %s\n",
-                      afs_ctime(&now, tbuffer, sizeof(tbuffer)));
+    snprintf(tmpStr, sizeof tmpStr, "List of active hosts at %s\n",
+            afs_ctime(&now, tbuffer, sizeof(tbuffer)));
     (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
     h_Enumerate(h_DumpHost, (char *)file);
     STREAM_REALLYCLOSE(file);
index 82c4aadaaf688ed0936df524c4ac7c6d18a6f933..7cf30426cf30ac9745561c0714625a6a1d7ccb35 100644 (file)
@@ -353,12 +353,13 @@ namei_ViceREADME(char *partition)
     int fd;
 
     /* Create the inode directory if we're starting for the first time */
-    (void)afs_snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s", partition,
-                      INODEDIR);
+    snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s", partition,
+            INODEDIR);
     mkdir(filename, 0700);
 
-    (void)afs_snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s" OS_DIRSEP "README",
-                       partition, INODEDIR);
+    snprintf(filename, sizeof filename,
+            "%s" OS_DIRSEP "%s" OS_DIRSEP "README",
+             partition, INODEDIR);
     fd = OS_OPEN(filename, O_WRONLY | O_CREAT | O_TRUNC, 0444);
     if (fd != INVALID_FD) {
        (void)OS_WRITE(fd, VICE_README, strlen(VICE_README));
@@ -382,7 +383,7 @@ namei_CreateDataDirectories(namei_t * name, int *created)
     int i;
 
     *created = 0;
-    afs_snprintf(tmp, 256, "%s" OS_DIRSEP "%s", name->n_drive, name->n_voldir);
+    snprintf(tmp, 256, "%s" OS_DIRSEP "%s", name->n_drive, name->n_voldir);
 
     if (mkdir(tmp) < 0) {
         if (errno != EEXIST)
@@ -540,7 +541,7 @@ namei_RemoveDataDirectories(namei_t * name)
     char tmp[256];
     int i;
 
-    afs_snprintf(tmp, 256, "%s" OS_DIRSEP "%s", name->n_drive, name->n_voldir);
+    snprintf(tmp, 256, "%s" OS_DIRSEP "%s", name->n_drive, name->n_voldir);
 
     path = tmp;
     path += strlen(path);
@@ -1067,7 +1068,7 @@ namei_dec(IHandle_t * ih, Inode ino, int p1)
        } else {
            IHandle_t *th;
            IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
-           Log("Warning: Lost ref on ihandle dev %d vid %d ino %" AFS_INT64_FMT "\n",
+           Log("Warning: Lost ref on ihandle dev %d vid %d ino %lld\n",
                th->ih_dev, th->ih_vid, (afs_int64)th->ih_ino);
            IH_RELEASE(th);
 
@@ -1171,7 +1172,7 @@ namei_copy_on_write(IHandle_t *h)
        fdP = IH_OPEN(h);
        if (!fdP)
            return EIO;
-       afs_snprintf(path, sizeof(path), "%s-tmp", name.n_path);
+       snprintf(path, sizeof(path), "%s-tmp", name.n_path);
        fd = OS_OPEN(path, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0);
        if (fd == INVALID_FD) {
            FDH_CLOSE(fdP);
@@ -1760,8 +1761,8 @@ namei_ListAFSFiles(char *dev,
 #else
            if (*dp1->d_name == '.')
                continue;
-           afs_snprintf(path2, sizeof(path2), "%s" OS_DIRSEP "%s", name.n_path,
-                        dp1->d_name);
+           snprintf(path2, sizeof(path2), "%s" OS_DIRSEP "%s", name.n_path,
+                    dp1->d_name);
            dirp2 = opendir(path2);
            if (dirp2) {
                while ((dp2 = readdir(dirp2))) {
@@ -1861,8 +1862,8 @@ _namei_examine_special(char * path1,
     } else {
        char path2[512];
        /* Open this handle */
-       (void)afs_snprintf(path2, sizeof(path2),
-                          "%s" OS_DIRSEP "%s", path1, dname);
+       snprintf(path2, sizeof(path2),
+                "%s" OS_DIRSEP "%s", path1, dname);
        linkHandle->fd_fd = OS_OPEN(path2, Testing ? O_RDONLY : O_RDWR, 0666);
        info.linkCount =
            namei_GetLinkCount(linkHandle, (Inode) 0, 1, 1, Testing);
@@ -2444,7 +2445,8 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
 
 #ifndef AFS_NT40_ENV /* This level missing on Windows */
            /* Now we've got a next level subdir. */
-           afs_snprintf(path2, sizeof(path2), "%s" OS_DIRSEP "%s", path1, dp1->d_name);
+           snprintf(path2, sizeof(path2), "%s" OS_DIRSEP "%s",
+                    path1, dp1->d_name);
            dirp2 = opendir(path2);
            if (dirp2) {
                while ((dp2 = readdir(dirp2))) {
@@ -2452,12 +2454,12 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
                        continue;
 
                    /* Now we've got to the actual data */
-                   afs_snprintf(path3, sizeof(path3), "%s" OS_DIRSEP "%s", path2,
-                                dp2->d_name);
+                   snprintf(path3, sizeof(path3), "%s" OS_DIRSEP "%s",
+                            path2, dp2->d_name);
 #else
                    /* Now we've got to the actual data */
-                   afs_snprintf(path3, sizeof(path3), "%s" OS_DIRSEP "%s", path1,
-                                dp1->d_name);
+                   snprintf(path3, sizeof(path3), "%s" OS_DIRSEP "%s",
+                            path1, dp1->d_name);
 #endif
                    dirp3 = opendir(path3);
                    if (dirp3) {
@@ -2598,7 +2600,7 @@ DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
     FdHandle_t linkHandle;
     char dirl;
 
-    afs_snprintf(fpath, sizeof(fpath), "%s" OS_DIRSEP "%s", dpath, name);
+    snprintf(fpath, sizeof(fpath), "%s" OS_DIRSEP "%s", dpath, name);
 
     dirH = FindFirstFileEx(fpath, FindExInfoStandard, &data,
                           FindExSearchNameMatch, NULL,
@@ -2670,7 +2672,7 @@ DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
     int parm, tag;
     lb64_string_t check;
 
-    afs_snprintf(fpath, sizeof(fpath), "%s" OS_DIRSEP "%s", dpath, name);
+    snprintf(fpath, sizeof(fpath), "%s" OS_DIRSEP "%s", dpath, name);
 
     if (afs_stat(fpath, &status) < 0) {
        return -1;
@@ -2913,8 +2915,8 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
     t_ih.ih_dev = ih->ih_dev;
     t_ih.ih_vid = ih->ih_vid;
 
-    (void)afs_snprintf(oldpath, sizeof oldpath, "%s" OS_DIRSEP "%s", dir_name,
-                      infoName);
+    snprintf(oldpath, sizeof oldpath, "%s" OS_DIRSEP "%s", dir_name,
+            infoName);
     fd = OS_OPEN(oldpath, O_RDWR, 0);
     if (fd == INVALID_FD) {
        Log("1 namei_ConvertROtoRWvolume: could not open RO info file: %s\n",
@@ -2944,8 +2946,8 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
 
     t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_SMALLINDEX);
     namei_HandleToName(&n, &t_ih);
-    (void)afs_snprintf(newpath, sizeof newpath, "%s" OS_DIRSEP "%s", dir_name,
-                      smallName);
+    snprintf(newpath, sizeof newpath, "%s" OS_DIRSEP "%s", dir_name,
+            smallName);
     fd = OS_OPEN(newpath, O_RDWR, 0);
     if (fd == INVALID_FD) {
        Log("1 namei_ConvertROtoRWvolume: could not open SmallIndex file: %s\n", newpath);
@@ -2963,8 +2965,8 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
 
     t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_LARGEINDEX);
     namei_HandleToName(&n, &t_ih);
-    (void)afs_snprintf(newpath, sizeof newpath, "%s" OS_DIRSEP "%s", dir_name,
-                      largeName);
+    snprintf(newpath, sizeof newpath, "%s" OS_DIRSEP "%s", dir_name,
+            largeName);
     fd = OS_OPEN(newpath, O_RDWR, 0);
     if (fd == INVALID_FD) {
        Log("1 namei_ConvertROtoRWvolume: could not open LargeIndex file: %s\n", newpath);
@@ -3025,7 +3027,7 @@ PrintInode(char *s, Inode ino)
     if (!s)
        s = result;
 
-    (void)afs_snprintf(s, sizeof(afs_ino_str_t), "%" AFS_UINT64_FMT, (afs_uintmax_t) ino);
+    snprintf(s, sizeof(afs_ino_str_t), "%llu", (afs_uintmax_t) ino);
 
     return s;
 }
index 48e18c2fcb44cfdec6d8e8fa82ce36a6ba1be591..2fec1bb8ecfd3bc972f3eb3c982954eae19acbff 100644 (file)
@@ -250,11 +250,11 @@ VInitPartition_r(char *path, char *devname, Device dev)
     dp->vol_list.busy = 0;
     {
        char lockpath[MAXPATHLEN+1];
-       afs_snprintf(lockpath, MAXPATHLEN, "%s/" AFS_PARTLOCK_FILE, dp->name);
+       snprintf(lockpath, MAXPATHLEN, "%s/" AFS_PARTLOCK_FILE, dp->name);
        lockpath[MAXPATHLEN] = '\0';
        VLockFileInit(&dp->headerLockFile, lockpath);
 
-       afs_snprintf(lockpath, MAXPATHLEN, "%s/" AFS_VOLUMELOCK_FILE, dp->name);
+       snprintf(lockpath, MAXPATHLEN, "%s/" AFS_VOLUMELOCK_FILE, dp->name);
        lockpath[MAXPATHLEN] = '\0';
        VLockFileInit(&dp->volLockFile, lockpath);
     }
@@ -1093,14 +1093,14 @@ VPrintDiskStats_r(void)
     struct DiskPartition64 *dp;
     for (dp = DiskPartitionList; dp; dp = dp->next) {
        if (dp->free < 0) {
-           Log("Partition %s: %"AFS_INT64_FMT
-               " available 1K blocks (minfree=%"AFS_INT64_FMT"), "
-               "overallocated by %"AFS_INT64_FMT" blocks\n", dp->name,
+           Log("Partition %s: %lld "
+               " available 1K blocks (minfree=%lld), "
+               "overallocated by %lld blocks\n", dp->name,
                dp->totalUsable, dp->minFree, -dp->free);
        } else {
-           Log("Partition %s: %"AFS_INT64_FMT
-               " available 1K blocks (minfree=%"AFS_INT64_FMT"), "
-               "%"AFS_INT64_FMT" free blocks\n", dp->name,
+           Log("Partition %s: %lld"
+               " available 1K blocks (minfree=%lld), "
+               "%lld free blocks\n", dp->name,
                dp->totalUsable, dp->minFree, dp->free);
        }
     }
index 6883849d61df7073b100e5499405fddca714c9c9..d977df900ee1fc95c4e6793bfd0ca7daef0497b2 100644 (file)
@@ -611,8 +611,8 @@ DoSalvageVolume(struct SalvageQueueNode * node, int slot)
      * another thread may have held the lock on the FILE
      * structure when fork was called! */
 
-    afs_snprintf(childLog, sizeof(childLog), "%s.%d",
-                AFSDIR_SERVER_SLVGLOG_FILEPATH, getpid());
+    snprintf(childLog, sizeof(childLog), "%s.%d",
+            AFSDIR_SERVER_SLVGLOG_FILEPATH, getpid());
 
     logFile = afs_fopen(childLog, "a");
     if (!logFile) {            /* still nothing, use stdout */
@@ -755,8 +755,8 @@ SalvageLogCleanup(int pid)
     char fn[AFSDIR_PATH_MAX];
     static char buf[LOG_XFER_BUF_SIZE];
 
-    afs_snprintf(fn, sizeof(fn), "%s.%d",
-                AFSDIR_SERVER_SLVGLOG_FILEPATH, pid);
+    snprintf(fn, sizeof(fn), "%s.%d",
+            AFSDIR_SERVER_SLVGLOG_FILEPATH, pid);
 
 
     pidlog = open(fn, O_RDONLY);
@@ -801,7 +801,7 @@ SalvageLogScanningThread(void * arg)
        char prefix[AFSDIR_PATH_MAX];
        size_t prefix_len;
 
-       afs_snprintf(prefix, sizeof(prefix), "%s.", AFSDIR_SLVGLOG_FILE);
+       snprintf(prefix, sizeof(prefix), "%s.", AFSDIR_SLVGLOG_FILE);
        prefix_len = strlen(prefix);
 
        dp = opendir(AFSDIR_LOGS_DIR);
index 7e4b3bae6ad46106e76310301dbfde9a34caf1a2..6a95cbd3bfc2519dc0fa1c8ae0722480798fc72e 100644 (file)
@@ -101,8 +101,8 @@ date(time_t date)
     char buf[32];
 
     (void)strftime(buf, 32, "%Y/%m/%d.%H:%M:%S", tm);  /* NT does not have %T */
-    (void)afs_snprintf(results[next = (next + 1) & 7], MAX_DATE_RESULT,
-                      "%lu (%s)", (unsigned long)date, buf);
+    snprintf(results[next = (next + 1) & 7], MAX_DATE_RESULT,
+            "%lu (%s)", (unsigned long)date, buf);
     return results[next];
 }
 
@@ -311,8 +311,8 @@ handleit(struct cmd_syndesc *as, void *arock)
                exit(1);
            }
        }
-       (void)afs_snprintf(name1, sizeof name1, VFORMAT,
-                          afs_printable_uint32_lu(volumeId));
+       snprintf(name1, sizeof name1, VFORMAT,
+                afs_printable_uint32_lu(volumeId));
        if (dsizeOnly && !saveinodes)
            printf
                ("Volume-Id\t  Volsize  Auxsize Inodesize  AVolsize SizeDiff                (VolName)\n");
@@ -446,8 +446,8 @@ HandleVolume(struct DiskPartition64 *dp, char *name)
     } else {
        afs_sfsize_t n;
 
-       (void)afs_snprintf(headerName, sizeof headerName, "%s" OS_DIRSEP "%s",
-                          VPartitionPath(dp), name);
+       snprintf(headerName, sizeof headerName, "%s" OS_DIRSEP "%s",
+                VPartitionPath(dp), name);
        if ((fd = OS_OPEN(headerName, O_RDONLY, 0666)) == INVALID_FD
            || OS_SIZE(fd) < 0) {
            printf("Volinfo: Cannot read volume header %s\n", name);
@@ -786,8 +786,8 @@ PrintVnodes(Volume * vp, VnodeClass class)
                           PrintInode(NULL, ino), errno);
                    continue;
                }
-               (void)afs_snprintf(nfile, sizeof nfile, "TmpInode.%s",
-                                  PrintInode(NULL, ino));
+               snprintf(nfile, sizeof nfile, "TmpInode.%s",
+                        PrintInode(NULL, ino));
                ofd = afs_open(nfile, O_CREAT | O_RDWR | O_TRUNC, 0600);
                if (ofd < 0) {
                    printf("Can't create file %s; error %d (ignored)\n",
index 5e43d2b9b7c63e1d8ae887fab3623e69e2311191..b212265b28b48fbff8746d55d485025e831273b6 100644 (file)
@@ -634,10 +634,9 @@ SalvageFileSysParallel(struct DiskPartition64 *partP)
                } else
 #endif
                {
-                   (void)afs_snprintf(logFileName, sizeof logFileName,
-                                      "%s.%d",
-                                      AFSDIR_SERVER_SLVGLOG_FILEPATH,
-                                      jobs[startjob]->jobnumb);
+                   snprintf(logFileName, sizeof logFileName, "%s.%d",
+                            AFSDIR_SERVER_SLVGLOG_FILEPATH,
+                            jobs[startjob]->jobnumb);
                    logFile = afs_fopen(logFileName, "w");
                }
                if (!logFile)
@@ -656,8 +655,8 @@ SalvageFileSysParallel(struct DiskPartition64 *partP)
 #endif
        if (!partP) {
            for (i = 0; i < jobcount; i++) {
-               (void)afs_snprintf(logFileName, sizeof logFileName, "%s.%d",
-                                  AFSDIR_SERVER_SLVGLOG_FILEPATH, i);
+               snprintf(logFileName, sizeof logFileName, "%s.%d",
+                        AFSDIR_SERVER_SLVGLOG_FILEPATH, i);
                if ((passLog = afs_fopen(logFileName, "r"))) {
                    while (fgets(buf, sizeof(buf), passLog)) {
                        fputs(buf, logFile);
@@ -1192,8 +1191,8 @@ GetInodeSummary(struct SalvInfo *salvinfo, FD_t inodeFile, VolumeId singleVolume
     (void)_putenv("TMP=");     /* If "TMP" is set, then that overrides tdir. */
     (void)strcpy(summaryFileName, _tempnam(tdir, "salvage.temp."));
 #else
-    (void)afs_snprintf(summaryFileName, sizeof summaryFileName,
-                      "%s" OS_DIRSEP "salvage.temp.%d", tdir, getpid());
+    snprintf(summaryFileName, sizeof summaryFileName,
+            "%s" OS_DIRSEP "salvage.temp.%d", tdir, getpid());
 #endif
     summaryFile = OS_OPEN(summaryFileName, O_RDWR|O_APPEND|O_CREAT, 0666);
     if (summaryFile == INVALID_FD) {
@@ -1578,8 +1577,8 @@ RecordHeader(struct DiskPartition64 *dp, const char *name,
            base = name;
        }
 
-       (void)afs_snprintf(nameShouldBe, sizeof nameShouldBe,
-                          VFORMAT, afs_printable_uint32_lu(summary.header.id));
+       snprintf(nameShouldBe, sizeof nameShouldBe,
+                VFORMAT, afs_printable_uint32_lu(summary.header.id));
 
 
        if (strcmp(nameShouldBe, base)) {
@@ -2300,8 +2299,10 @@ SalvageVolumeHeaderFile(struct SalvInfo *salvinfo, struct InodeSummary *isp,
     if (isp->volSummary == NULL) {
        char path[64];
        char headerName[64];
-       (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_printable_uint32_lu(isp->volumeId));
-       (void)afs_snprintf(path, sizeof path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, headerName);
+       snprintf(headerName, sizeof headerName, VFORMAT,
+                afs_printable_uint32_lu(isp->volumeId));
+       snprintf(path, sizeof path, "%s" OS_DIRSEP "%s",
+                salvinfo->fileSysPath, headerName);
        if (check) {
            Log("No header file for volume %u\n", isp->volumeId);
            return -1;
@@ -2328,10 +2329,12 @@ SalvageVolumeHeaderFile(struct SalvInfo *salvinfo, struct InodeSummary *isp,
            if (isp->volSummary->fileName) {
                strcpy(headerName, isp->volSummary->fileName);
            } else {
-               (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_printable_uint32_lu(isp->volumeId));
+               snprintf(headerName, sizeof headerName, VFORMAT,
+                        afs_printable_uint32_lu(isp->volumeId));
                isp->volSummary->fileName = ToString(headerName);
            }
-           (void)afs_snprintf(path, sizeof path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, headerName);
+           snprintf(path, sizeof path, "%s" OS_DIRSEP "%s",
+                    salvinfo->fileSysPath, headerName);
 
            Log("Header file %s is damaged or no longer valid%s\n", path,
                (check ? "" : "; repairing"));
@@ -3973,11 +3976,10 @@ SalvageVolume(struct SalvInfo *salvinfo, struct InodeSummary *rwIsp, IHandle_t *
                    pa.Vnode = ThisVnode;
                    pa.Unique = ThisUnique;
 
-                   (void)afs_snprintf(npath, sizeof npath, "%s.%u.%u",
-                                      ((class ==
-                                        vLarge) ? "__ORPHANDIR__" :
-                                       "__ORPHANFILE__"), ThisVnode,
-                                      ThisUnique);
+                   snprintf(npath, sizeof npath, "%s.%u.%u",
+                            ((class == vLarge) ? "__ORPHANDIR__"
+                                               : "__ORPHANFILE__"),
+                            ThisVnode, ThisUnique);
 
                    CopyOnWrite(salvinfo, &rootdir);
                    code = Create(&rootdir.dirHandle, npath, &pa);
@@ -4697,11 +4699,10 @@ TimeStampLogFile(char * log_path)
 
     now = time(0);
     lt = localtime(&now);
-    (void)afs_snprintf(stampSlvgLog, sizeof stampSlvgLog,
-                      "%s.%04d-%02d-%02d.%02d:%02d:%02d",
-                      log_path, lt->tm_year + 1900,
-                      lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min,
-                      lt->tm_sec);
+    snprintf(stampSlvgLog, sizeof stampSlvgLog,
+            "%s.%04d-%02d-%02d.%02d:%02d:%02d", log_path,
+            lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour,
+            lt->tm_min, lt->tm_sec);
 
     /* try to link the logfile to a timestamped filename */
     /* if it fails, oh well, nothing we can do */
@@ -4747,7 +4748,7 @@ Log(const char *format, ...)
     va_list args;
 
     va_start(args, format);
-    (void)afs_vsnprintf(tmp, sizeof tmp, format, args);
+    vsnprintf(tmp, sizeof tmp, format, args);
     va_end(args);
 #ifndef AFS_NT40_ENV
     if (useSyslog) {
@@ -4768,7 +4769,7 @@ Abort(const char *format, ...)
     char tmp[1024];
 
     va_start(args, format);
-    (void)afs_vsnprintf(tmp, sizeof tmp, format, args);
+    vsnprintf(tmp, sizeof tmp, format, args);
     va_end(args);
 #ifndef AFS_NT40_ENV
     if (useSyslog) {
index d884a40c938693a9f0bb5f165d9181eb43af9b19..bf8c02b33ffbcee94e0fa907110fb0187857ad2f 100644 (file)
@@ -6495,7 +6495,8 @@ VGetVolumePath(Error * ec, VolId volumeId, char **partitionp, char **namep)
 
     *ec = 0;
     name[0] = OS_DIRSEPC;
-    (void)afs_snprintf(&name[1], (sizeof name) - 1, VFORMAT, afs_printable_uint32_lu(volumeId));
+    snprintf(&name[1], (sizeof name) - 1, VFORMAT,
+            afs_printable_uint32_lu(volumeId));
     for (dp = DiskPartitionList; dp; dp = dp->next) {
        struct afs_stat_st status;
        strcpy(path, VPartitionPath(dp));
@@ -6558,7 +6559,7 @@ char *
 VolumeExternalName(VolumeId volumeId)
 {
     static char name[VMAXPATHLEN];
-    (void)afs_snprintf(name, sizeof name, VFORMAT, afs_printable_uint32_lu(volumeId));
+    snprintf(name, sizeof name, VFORMAT, afs_printable_uint32_lu(volumeId));
     return name;
 }
 
@@ -6579,7 +6580,7 @@ VolumeExternalName(VolumeId volumeId)
 int
 VolumeExternalName_r(VolumeId volumeId, char * name, size_t len)
 {
-    return afs_snprintf(name, len, VFORMAT, afs_printable_uint32_lu(volumeId));
+    return snprintf(name, len, VFORMAT, afs_printable_uint32_lu(volumeId));
 }
 
 
index 55e60a6fa4caaf51a3c85e91b7456825db343d76..b9183899396d0bf5d1b1fc4b9ee5e89053e96484 100644 (file)
@@ -194,9 +194,10 @@ VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId)
     vol.stamp.magic = VOLUMEINFOMAGIC;
     vol.stamp.version = VOLUMEINFOVERSION;
     vol.destroyMe = DESTROY_ME;
-    (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_printable_uint32_lu(vol.id));
-    (void)afs_snprintf(volumePath, sizeof volumePath, "%s" OS_DIRSEP "%s",
-                      VPartitionPath(partition), headerName);
+    snprintf(headerName, sizeof headerName, VFORMAT,
+            afs_printable_uint32_lu(vol.id));
+    snprintf(volumePath, sizeof volumePath, "%s" OS_DIRSEP "%s",
+            VPartitionPath(partition), headerName);
     rc = stat(volumePath, &st);
     if (rc == 0 || errno != ENOENT) {
        if (rc == 0) {
@@ -422,9 +423,8 @@ VReadVolumeDiskHeader(VolumeId volid,
     int fd;
     char path[MAXPATHLEN];
 
-    (void)afs_snprintf(path, sizeof(path),
-                      "%s" OS_DIRSEP VFORMAT,
-                      VPartitionPath(dp), afs_printable_uint32_lu(volid));
+    snprintf(path, sizeof(path), "%s" OS_DIRSEP VFORMAT,
+            VPartitionPath(dp), afs_printable_uint32_lu(volid));
     fd = open(path, O_RDONLY);
     if (fd < 0) {
        Log("VReadVolumeDiskHeader: Couldn't open header for volume %lu (errno %d).\n",
@@ -478,9 +478,8 @@ _VWriteVolumeDiskHeader(VolumeDiskHeader_t * hdr,
 
     flags |= O_RDWR;
 
-    (void)afs_snprintf(path, sizeof(path),
-                      "%s" OS_DIRSEP VFORMAT,
-                      VPartitionPath(dp), afs_printable_uint32_lu(hdr->id));
+    snprintf(path, sizeof(path), "%s" OS_DIRSEP VFORMAT,
+            VPartitionPath(dp), afs_printable_uint32_lu(hdr->id));
     fd = open(path, flags, 0644);
     if (fd < 0) {
        code = errno;
@@ -658,9 +657,8 @@ VDestroyVolumeDiskHeader(struct DiskPartition64 * dp,
     SYNC_response res;
 #endif /* AFS_DEMAND_ATTACH_FS */
 
-    (void)afs_snprintf(path, sizeof(path),
-                       "%s" OS_DIRSEP VFORMAT,
-                       VPartitionPath(dp), afs_printable_uint32_lu(volid));
+    snprintf(path, sizeof(path), "%s" OS_DIRSEP VFORMAT,
+             VPartitionPath(dp), afs_printable_uint32_lu(volid));
     code = unlink(path);
     if (code) {
        Log("VDestroyVolumeDiskHeader: Couldn't unlink disk header, error = %d\n", errno);
index f8f198e539c12562ca8d8dd63984998152fd9ba1..700173730d57f3c3567f6c588e09140ddd616546 100644 (file)
@@ -42,6 +42,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
 #include <afs/afsint.h>
 #include <afs/nfs.h>
@@ -474,16 +475,16 @@ ReadVNode(afs_int32 count)
            if (vnode == 1)
                strncpy(parentdir, rootdir, sizeof parentdir);
            else {
-               afs_snprintf(parentdir, sizeof parentdir, "%s" OS_DIRSEP "%s%d", rootdir,
-                            ADIR, vnode);
+               snprintf(parentdir, sizeof parentdir,
+                        "%s" OS_DIRSEP "%s%d", rootdir, ADIR, vnode);
 
                len = readlink(parentdir, linkname, MAXNAMELEN);
                if (len < 0) {
                    /* parentdir does not exist. So create an orphan dir.
                     * and then link the parentdir to the orphaned dir.
                     */
-                   afs_snprintf(linkname, sizeof linkname, "%s" OS_DIRSEP "%s%d",
-                                rootdir, ODIR, vnode);
+                   snprintf(linkname, sizeof linkname, "%s" OS_DIRSEP "%s%d",
+                            rootdir, ODIR, vnode);
                    code = mkdir(linkname, 0777);
                    if ((code < 0) && (errno != EEXIST)) {
                        fprintf(stderr,
@@ -492,8 +493,8 @@ ReadVNode(afs_int32 count)
                    }
 
                    /* Link the parentdir to it - now parentdir exists */
-                   afs_snprintf(linkname, sizeof linkname, "%s%d/", ODIR,
-                                vnode);
+                   snprintf(linkname, sizeof linkname, "%s%d/", ODIR,
+                            vnode);
                    code = symlink(linkname, parentdir);
                    if (code) {
                        fprintf(stderr,
@@ -575,10 +576,12 @@ ReadVNode(afs_int32 count)
                                /* dirname is the directory to create.
                                 * vflink is what will link to it.
                                 */
-                               afs_snprintf(dirname, sizeof dirname, "%s" OS_DIRSEP "%s",
-                                            parentdir, this_name);
-                           afs_snprintf(vflink, sizeof vflink, "%s" OS_DIRSEP "%s%d",
-                                        rootdir, ADIR, this_vn);
+                           snprintf(dirname, sizeof dirname,
+                                    "%s" OS_DIRSEP "%s",
+                                    parentdir, this_name);
+                           snprintf(vflink, sizeof vflink,
+                                    "%s" OS_DIRSEP "%s%d",
+                                    rootdir, ADIR, this_vn);
 
                            /* The link and directory may already exist */
                            len = readlink(vflink, linkname, MAXNAMELEN);
@@ -597,8 +600,9 @@ ReadVNode(afs_int32 count)
                                 * It was created originally as orphaned.
                                 */
                                linkname[len - 1] = '\0';       /* remove '/' at end */
-                               afs_snprintf(lname, sizeof lname, "%s" OS_DIRSEP "%s",
-                                            rootdir, linkname);
+                               snprintf(lname, sizeof lname,
+                                        "%s" OS_DIRSEP "%s",
+                                        rootdir, linkname);
                                code = rename(lname, dirname);
                                if (code) {
                                    fprintf(stderr,
@@ -609,12 +613,11 @@ ReadVNode(afs_int32 count)
 
                            /* Now create/update the link to the new/moved directory */
                            if (vn.vnode == 1)
-                               afs_snprintf(dirname, sizeof dirname, "%s/",
-                                            this_name);
+                               snprintf(dirname, sizeof dirname, "%s/",
+                                        this_name);
                            else
-                               afs_snprintf(dirname, sizeof dirname,
-                                            "%s%d/%s/", ADIR, vn.vnode,
-                                            this_name);
+                               snprintf(dirname, sizeof dirname, "%s%d/%s/",
+                                        ADIR, vn.vnode, this_name);
                            unlink(vflink);
                            code = symlink(dirname, vflink);
                            if (code) {
@@ -628,11 +631,11 @@ ReadVNode(afs_int32 count)
                             * by creating a link within the directory. Restoring
                             * the file will later remove the link.
                             */
-                           else {
-                            /*AFILEENTRY*/ afs_snprintf(vflink,
-                                                        sizeof vflink,
-                                                        "%s" OS_DIRSEP "%s%d", parentdir,
-                                                        AFILE, this_vn);
+                       else {
+                            /*AFILEENTRY*/
+                           snprintf(vflink, sizeof vflink,
+                                    "%s" OS_DIRSEP "%s%d", parentdir,
+                                    AFILE, this_vn);
 
                            code = symlink(this_name, vflink);
                            if ((code < 0) && (errno != EEXIST)) {
@@ -660,12 +663,12 @@ ReadVNode(afs_int32 count)
                 * then the file will be an orphaned file.
                 */
                lfile = 1;
-               afs_snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s%d", parentdir,
-                            AFILE, vn.vnode);
+               snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s%d",
+                        parentdir, AFILE, vn.vnode);
                len = readlink(filename, fname, MAXNAMELEN);
                if (len < 0) {
-                   afs_snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s%d",
-                                rootdir, OFILE, vn.vnode);
+                   snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s%d",
+                            rootdir, OFILE, vn.vnode);
                    lfile = 0;  /* no longer a linked file; a direct path */
                }
 
@@ -692,11 +695,10 @@ ReadVNode(afs_int32 count)
                                    errno);
                        else {
                            char tmp[100];
-                           (void)afs_snprintf(tmp, sizeof tmp,
-                                              "Read %llu bytes out of %llu",
-                                              (afs_uintmax_t) (vn.dataSize -
-                                                               size),
-                                              (afs_uintmax_t) vn.dataSize);
+                           snprintf(tmp, sizeof tmp,
+                                    "Read %llu bytes out of %llu",
+                                    (afs_uintmax_t) (vn.dataSize - size),
+                                    (afs_uintmax_t) vn.dataSize);
                            fprintf(stderr, "%s\n", tmp);
                        }
                        break;
@@ -726,16 +728,16 @@ ReadVNode(afs_int32 count)
                 * of the symbolic link. If it doesn't exist,
                 * then the link will be an orphaned link.
                 */
-               afs_snprintf(linkname, sizeof linkname, "%s" OS_DIRSEP "%s%d", parentdir,
-                            AFILE, vn.vnode);
+               snprintf(linkname, sizeof linkname, "%s" OS_DIRSEP "%s%d",
+                        parentdir, AFILE, vn.vnode);
                len = readlink(linkname, fname, MAXNAMELEN);
                if (len < 0) {
-                   afs_snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s%d",
-                                rootdir, OFILE, vn.vnode);
+                   snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s%d",
+                            rootdir, OFILE, vn.vnode);
                } else {
                    fname[len] = '\0';
-                   afs_snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s",
-                                parentdir, fname);
+                   snprintf(filename, sizeof filename, "%s" OS_DIRSEP "%s",
+                            parentdir, fname);
                }
 
                /* Read the link in, delete it, and then create it */
@@ -922,20 +924,20 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
        dirP = opendir(rootdir);
        while (dirP && (dirE = readdir(dirP))) {
            if (strncmp(dirE->d_name, ADIR, strlen(ADIR)) == 0) {
-               afs_snprintf(name, sizeof name, "%s" OS_DIRSEP "%s", rootdir,
-                            dirE->d_name);
+               snprintf(name, sizeof name, "%s" OS_DIRSEP "%s", rootdir,
+                        dirE->d_name);
                dirQ = opendir(name);
                while (dirQ && (dirF = readdir(dirQ))) {
                    if (strncmp(dirF->d_name, AFILE, strlen(AFILE)) == 0) {
-                       afs_snprintf(name, sizeof name, "%s" OS_DIRSEP "%s/%s", rootdir,
-                                    dirE->d_name, dirF->d_name);
+                       snprintf(name, sizeof name, "%s" OS_DIRSEP "%s/%s",
+                                rootdir, dirE->d_name, dirF->d_name);
                        unlink(name);
                    }
                }
                closedir(dirQ);
            } else if (strncmp(dirE->d_name, AFILE, strlen(AFILE)) == 0) {
-               afs_snprintf(name, sizeof name, "%s" OS_DIRSEP "%s", rootdir,
-                            dirE->d_name);
+               snprintf(name, sizeof name, "%s" OS_DIRSEP "%s", rootdir,
+                        dirE->d_name);
                unlink(name);
            }
        }
@@ -946,7 +948,8 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
     dirP = opendir(rootdir);
     while (dirP && (dirE = readdir(dirP))) {
        if (strncmp(dirE->d_name, ADIR, strlen(ADIR)) == 0) {
-           afs_snprintf(name, sizeof name, "%s" OS_DIRSEP "%s", rootdir, dirE->d_name);
+           snprintf(name, sizeof name, "%s" OS_DIRSEP "%s", rootdir,
+                    dirE->d_name);
            unlink(name);
        }
     }
index adcdc3e2b2c4c5c3ae48c8c157fb8703a8246ef8..680e828ad750a1caa7a68382bc768a968bd06c2f 100644 (file)
@@ -21,6 +21,8 @@
 # pragma GCC diagnostic warning "-Wformat"
 #endif
 
+#include <roken.h>
+
 #include <ctype.h>
 #include <errno.h>
 #include <sys/stat.h>
@@ -233,7 +235,7 @@ handleit(struct cmd_syndesc *as, void *arock)
        exit(1);
     }
 
-    (void)afs_snprintf(name1, sizeof name1, VFORMAT, (unsigned long)volumeId);
+    snprintf(name1, sizeof name1, VFORMAT, (unsigned long)volumeId);
     HandleVolume(partP, name1, fileName, fromtime);
     return 0;
 }
@@ -250,8 +252,8 @@ HandleVolume(struct DiskPartition64 *dp, char *name, char *filename, int fromtim
 
     afs_int32 n;
 
-    (void)afs_snprintf(headerName, sizeof headerName, "%s" OS_DIRSEP "%s",
-                      VPartitionPath(dp), name);
+    snprintf(headerName, sizeof headerName, "%s" OS_DIRSEP "%s",
+            VPartitionPath(dp), name);
     if ((fd = afs_open(headerName, O_RDONLY)) == -1
        || afs_fstat(fd, &status) == -1) {
        fprintf(stderr, "Cannot read volume header %s\n", name);
index c34cbbeed76aa684184072565cdb0264a3ecd38f..cb3196dffb300ead92c58e283d24f426fc500f59 100644 (file)
@@ -349,9 +349,8 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
            afs_uint64 size;
            offset = (e->vN + 1 - class) << (vcp->logSize -1);
            if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
-               Log("Couldn't read in %s Index of volume %u at offset %"
-                   AFS_UINT64_FMT "\n", class ? "small":"large",
-                   V_id(vol), offset);
+               Log("Couldn't read in %s Index of volume %u at offset %llu\n",
+                   class ? "small":"large", V_id(vol), offset);
                code = EIO;
                goto Bad_Copy;
            }
@@ -381,9 +380,8 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
                VNDISK_SET_INO(vnode, newino);
                vnode->cloned = 0;
                if (FDH_PWRITE(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
-                   Log("Couldn't write in %s Index of volume %u at offset %"
-                       AFS_UINT64_FMT "\n", class ? "small":"large",
-                       V_id(vol), offset);
+                   Log("Couldn't write in %s Index of volume %u at offset %llu\n",
+                       class ? "small":"large", V_id(vol), offset);
                    code = EIO;
                    goto Bad_Copy;
                }
@@ -428,9 +426,8 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
                    vnode->parent = 1; /* in new root-directory */
                vnode->cloned = 0;
                if (FDH_PWRITE(newfdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
-                   Log("Couldn't write in %s Index of volume %u to offset %"
-                       AFS_UINT64_FMT "\n", class ? "small":"large",
-                       V_id(newvol), offset);
+                   Log("Couldn't write in %s Index of volume %u to offset %llu\n",
+                       class ? "small":"large", V_id(newvol), offset);
                    code = EIO;
                    goto Bad_Copy;
                }
@@ -455,8 +452,8 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
        }
        offset = (where + 1 - class) << (vcp->logSize -1);
        if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
-           Log("Couldn't read in large Index of old volume %u at offset %"
-               AFS_UINT64_FMT "\n", V_id(vol), offset);
+           Log("Couldn't read in large Index of old volume %u at offset %llu\n",
+               V_id(vol), offset);
            code = EIO;
            goto Bad_Copy;
        }
@@ -667,9 +664,8 @@ deleteVnodes(Volume *vol, afs_int32 class,
        if (e->flag & NEEDED) {
            offset = (e->vN + 1 - class) << (vcp->logSize -1);
            if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
-               Log("Couldn't read in %s Index of volume %u at offset %"
-                   AFS_UINT64_FMT "\n", class ? "small":"large", V_id(vol),
-                   offset);
+               Log("Couldn't read in %s Index of volume %u at offset %llu\n",
+                   class ? "small":"large", V_id(vol), offset);
                code = EIO;
                goto Bad_Delete;
            }
@@ -688,9 +684,8 @@ deleteVnodes(Volume *vol, afs_int32 class,
            memset(vnode, 0, vcp->diskSize);
            vnode->type = vNull;
            if (FDH_PWRITE(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
-                  Log("Couldn't write in %s Index of volume %u to offset %"
-                      AFS_UINT64_FMT "\n", class ? "small":"large",
-                      V_id(vol), offset);
+                  Log("Couldn't write in %s Index of volume %u to offset %llu\n",
+                      class ? "small":"large", V_id(vol), offset);
            }
         }
     }
index 7b9891e13992a2e92395b4d9e9387eeeeb71a0fd..012a8c3e18c93d347224ff00f3eeb87a6b7f5b92 100644 (file)
@@ -197,7 +197,7 @@ ConvertVolume(afs_uint32 avol, char *aname, afs_int32 asize)
     if (asize < 18)
        return -1;
     /* It's better using the Generic VFORMAT since otherwise we have to make changes to too many places... The 14 char limitation in names hits us again in AIX; print in field of 9 digits (still 10 for the rest), right justified with 0 padding */
-    (void)afs_snprintf(aname, asize, VFORMAT, (unsigned long)avol);
+    snprintf(aname, asize, VFORMAT, (unsigned long)avol);
     return 0;
 }