patch 1
Bear Giles
bear at coyotesong.com
Sat Jun 9 19:05:40 UTC 2001
diff -Naur --recursive inn2-2.3.1.orig/backends/archive.c inn2-2.3.1/backends/archive.c
--- inn2-2.3.1.orig/backends/archive.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/archive.c Fri Jun 8 19:31:36 2001
@@ -110,7 +110,7 @@
{
register FILE *in;
register FILE *out;
- register SIZE_T i;
+ register size_t i;
char *p;
char buff[BUFSIZ];
@@ -142,8 +142,8 @@
}
/* Write the data. */
- while ((i = fread((POINTER)buff, (SIZE_T)1, (SIZE_T)sizeof buff, in)) != 0)
- if (fwrite((POINTER)buff, (SIZE_T)1, i, out) != i) {
+ while ((i = fread((POINTER)buff, (size_t)1, (size_t)sizeof buff, in)) != 0)
+ if (fwrite((POINTER)buff, (size_t)1, i, out) != i) {
(void)fprintf(stderr, "Can't write \"%s\", %s\n",
dest, strerror(errno));
(void)fclose(in);
diff -Naur --recursive inn2-2.3.1.orig/backends/batcher.c inn2-2.3.1/backends/batcher.c
--- inn2-2.3.1.orig/backends/batcher.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/batcher.c Fri Jun 8 19:31:39 2001
@@ -223,7 +223,7 @@
int BytesInArt;
long BytesInCB;
OFFSET_T Cookie;
- SIZE_T datasize;
+ size_t datasize;
int i;
int ArtsInCB;
int length;
diff -Naur --recursive inn2-2.3.1.orig/backends/buffchan.c inn2-2.3.1/backends/buffchan.c
--- inn2-2.3.1.orig/backends/buffchan.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/buffchan.c Fri Jun 8 19:31:42 2001
@@ -268,7 +268,7 @@
if (sp->F == NULL)
SITEopen(sp);
- if (fwrite((POINTER)text, (SIZE_T)1, (SIZE_T)len, sp->F) != len)
+ if (fwrite((POINTER)text, (size_t)1, (size_t)len, sp->F) != len)
(void)fprintf(stderr, "buffchan %s cant write %s\n",
sp->Name, strerror(errno));
diff -Naur --recursive inn2-2.3.1.orig/backends/filechan.c inn2-2.3.1/backends/filechan.c
--- inn2-2.3.1.orig/backends/filechan.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/filechan.c Fri Jun 8 19:31:45 2001
@@ -34,9 +34,9 @@
BOOL Map;
FILE *F;
struct stat Sb;
- UID_T uid;
- GID_T gid;
- UID_T myuid;
+ uid_t uid;
+ gid_t gid;
+ uid_t myuid;
/* First thing, set up logging and our identity. */
openlog("filechan", L_OPENLOG_FLAGS | LOG_PID, LOG_INN_PROG);
@@ -134,7 +134,7 @@
(void)lseek(fd, (OFFSET_T) 0, SEEK_END);
errno = 0;
- if (write(fd, (POINTER)buff, (SIZE_T)i) != i) {
+ if (write(fd, (POINTER)buff, (size_t)i) != i) {
perror("write");
exit(1);
}
diff -Naur --recursive inn2-2.3.1.orig/backends/innxmit.c inn2-2.3.1/backends/innxmit.c
--- inn2-2.3.1.orig/backends/innxmit.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/innxmit.c Fri Jun 8 19:31:47 2001
@@ -318,7 +318,7 @@
/* Dot escape, text of the line, line terminator. */
if (escdot && (*p == '.'))
*REMbuffptr++ = '.';
- (void)memcpy((POINTER)REMbuffptr, (POINTER)p, (SIZE_T)i);
+ (void)memcpy((POINTER)REMbuffptr, (POINTER)p, (size_t)i);
REMbuffptr += i;
*REMbuffptr++ = '\r';
*REMbuffptr++ = '\n';
diff -Naur --recursive inn2-2.3.1.orig/backends/shlock.c inn2-2.3.1/backends/shlock.c
--- inn2-2.3.1.orig/backends/shlock.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/shlock.c Fri Jun 8 19:31:51 2001
@@ -30,7 +30,7 @@
{
register int fd;
register int i;
- PID_T pid;
+ pid_t pid;
char buff[BUFSIZ];
/* Open the file. */
@@ -54,7 +54,7 @@
return FALSE;
}
buff[i] = '\0';
- pid = (PID_T) atol(buff);
+ pid = (pid_t) atol(buff);
}
(void)close(fd);
if (pid <= 0)
@@ -106,7 +106,7 @@
char tmp[BUFSIZ];
char buff[BUFSIZ];
char *name;
- PID_T pid;
+ pid_t pid;
BOOL ok;
BOOL JustChecking;
@@ -130,7 +130,7 @@
JustChecking = TRUE;
break;
case 'p':
- pid = (PID_T) atol(optarg);
+ pid = (pid_t) atol(optarg);
break;
case 'f':
name = optarg;
@@ -168,11 +168,11 @@
/* Write the process ID. */
if (BinaryLock)
- ok = write(fd, (POINTER)&pid, (SIZE_T)sizeof pid) == sizeof pid;
+ ok = write(fd, (POINTER)&pid, (size_t)sizeof pid) == sizeof pid;
else {
(void)sprintf(buff, "%ld\n", (long) pid);
i = strlen(buff);
- ok = write(fd, (POINTER)buff, (SIZE_T)i) == i;
+ ok = write(fd, (POINTER)buff, (size_t)i) == i;
}
if (!ok) {
(void)fprintf(stderr, "Can't write PID to \"%s\", %s\n",
diff -Naur --recursive inn2-2.3.1.orig/backends/shrinkfile.c inn2-2.3.1/backends/shrinkfile.c
--- inn2-2.3.1.orig/backends/shrinkfile.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/backends/shrinkfile.c Fri Jun 8 19:31:58 2001
@@ -224,8 +224,8 @@
/* Copy rest of file to temp. */
tmp = OpenTemp();
- while ((i = fread((POINTER)buff, (SIZE_T)1, (SIZE_T)sizeof buff, F)) > 0)
- if (fwrite((POINTER)buff, (SIZE_T)1, (SIZE_T)i, tmp) != i) {
+ while ((i = fread((POINTER)buff, (size_t)1, (size_t)sizeof buff, F)) > 0)
+ if (fwrite((POINTER)buff, (size_t)1, (size_t)i, tmp) != i) {
i = -1;
break;
}
@@ -247,8 +247,8 @@
}
(void)fseek(tmp, (OFFSET_T)0, SEEK_SET);
- while ((i = fread((POINTER)buff, (SIZE_T)1, (SIZE_T)sizeof buff, tmp)) > 0)
- if (fwrite((POINTER)buff, (SIZE_T)1, (SIZE_T)i, F) != i) {
+ while ((i = fread((POINTER)buff, (size_t)1, (size_t)sizeof buff, tmp)) > 0)
+ if (fwrite((POINTER)buff, (size_t)1, (size_t)i, F) != i) {
i = -1;
break;
}
diff -Naur --recursive inn2-2.3.1.orig/expire/makehistory.c inn2-2.3.1/expire/makehistory.c
--- inn2-2.3.1.orig/expire/makehistory.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/expire/makehistory.c Fri Jun 8 19:32:02 2001
@@ -102,7 +102,7 @@
}
/* Try to test for non-overlapping copies. */
- memmove((POINTER)bp->Data, (POINTER)p, (SIZE_T)length);
+ memmove((POINTER)bp->Data, (POINTER)p, (size_t)length);
}
bp->Used = 0;
}
@@ -164,7 +164,7 @@
B.Size = length;
RENEW(B.Data, char, B.Size + 1);
}
- (void)memcpy((POINTER)B.Data, (POINTER)p, (SIZE_T)length + 1);
+ (void)memcpy((POINTER)B.Data, (POINTER)p, (size_t)length + 1);
for (p = B.Data; *p; p++)
if (*p == HIS_FIELDSEP)
@@ -352,7 +352,7 @@
if (sorttype == OVNOSORT) {
if (Fork) {
(void)fprintf(Overchan, "%s %d %d ", TokenToText(*token), arrived, expires);
- if (fwrite((POINTER)overdata, (SIZE_T)1, (SIZE_T)overlen, Overchan) != overlen) {
+ if (fwrite((POINTER)overdata, (size_t)1, (size_t)overlen, Overchan) != overlen) {
fprintf(stderr, "makehistory: writing overview failed\n");
exit(1);
}
diff -Naur --recursive inn2-2.3.1.orig/expire/newsrequeue.c inn2-2.3.1/expire/newsrequeue.c
--- inn2-2.3.1.orig/expire/newsrequeue.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/expire/newsrequeue.c Fri Jun 8 19:32:06 2001
@@ -299,7 +299,7 @@
return;
/* Fill in the subbed array with the mask of groups. */
- (void)memset((POINTER)subbed, SUB_DEFAULT, (SIZE_T)nGroups);
+ (void)memset((POINTER)subbed, SUB_DEFAULT, (size_t)nGroups);
if ((pat = strtok(sp->Patterns, SEPS)) != NULL)
do {
subvalue = *pat != SUB_NEGATE;
diff -Naur --recursive inn2-2.3.1.orig/expire/prunehistory.c inn2-2.3.1/expire/prunehistory.c
--- inn2-2.3.1.orig/expire/prunehistory.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/expire/prunehistory.c Fri Jun 8 19:32:10 2001
@@ -203,7 +203,7 @@
where = ftell(rfp);
/* Read the the first chunk. */
- i = fread((POINTER)Line.Data, (SIZE_T)1, BUFSIZ, rfp);
+ i = fread((POINTER)Line.Data, (size_t)1, BUFSIZ, rfp);
if (i <= 0) {
(void)fprintf(stderr, "Bad read for \"%s\", %s\n",
buff, strerror(errno));
@@ -212,12 +212,12 @@
Line.Used = i;
/* No newline; get another chunk and try again. */
- while ((p = memchr((POINTER)Line.Data, '\n', (SIZE_T)Line.Used)) == NULL) {
+ while ((p = memchr((POINTER)Line.Data, '\n', (size_t)Line.Used)) == NULL) {
if (Line.Used + BUFSIZ >= Line.Size) {
Line.Size += BUFSIZ;
RENEW(Line.Data, char, Line.Size);
}
- i = fread((POINTER)&Line.Data[Line.Used], (SIZE_T)1, BUFSIZ, rfp);
+ i = fread((POINTER)&Line.Data[Line.Used], (size_t)1, BUFSIZ, rfp);
if (i <= 0)
break;
Line.Used += i;
@@ -242,7 +242,7 @@
/* If Message-ID was only thing on line, zap the text line. */
if (*files == '\0') {
- (void)memset((POINTER)Line.Data, ' ', (SIZE_T)Line.Used);
+ (void)memset((POINTER)Line.Data, ' ', (size_t)Line.Used);
if (xwrite(wfd, Line.Data, Line.Used) < 0)
(void)fprintf(stderr, "Can't blank \"%s\", %s\n",
buff, strerror(errno));
diff -Naur --recursive inn2-2.3.1.orig/frontends/inews.c inn2-2.3.1/frontends/inews.c
--- inn2-2.3.1.orig/frontends/inews.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/frontends/inews.c Fri Jun 8 19:32:17 2001
@@ -800,7 +800,7 @@
}
/* Read it in. */
- length = fread((POINTER)buff, (SIZE_T)1, (SIZE_T)sizeof buff - 2, F);
+ length = fread((POINTER)buff, (size_t)1, (size_t)sizeof buff - 2, F);
i = feof(F);
(void)fclose(F);
if (length == 0) {
@@ -941,7 +941,7 @@
STATIC void
Spoolit(article, Length, deadfile)
char *article;
- SIZE_T Length;
+ size_t Length;
char *deadfile;
{
register HEADER *hp;
@@ -966,7 +966,7 @@
PerrorExit(FALSE, "Can't write headers");
/* Write the article and exit. */
- if (fwrite((POINTER)article, (SIZE_T)1, Length, F) != Length)
+ if (fwrite((POINTER)article, (size_t)1, Length, F) != Length)
PerrorExit(FALSE, "Can't write article");
if (FLUSH_ERROR(F))
PerrorExit(FALSE, "Can't write article");
@@ -1008,7 +1008,7 @@
char SpoolMessage[HEADER_STRLEN];
BOOL DoSignature;
BOOL AddOrg;
- SIZE_T Length;
+ size_t Length;
/* First thing, set up logging and our identity. */
openlog("inews", L_OPENLOG_FLAGS | LOG_PID, LOG_INN_PROG);
@@ -1016,7 +1016,7 @@
/* Find out who we are. */
if ((i = geteuid()) < 0)
PerrorExit(TRUE, "Can't get your user ID");
- if ((pwp = getpwuid((UID_T)i)) == NULL)
+ if ((pwp = getpwuid((uid_t)i)) == NULL)
PerrorExit(TRUE, "Can't get your password entry");
/* Set defaults. */
@@ -1187,7 +1187,7 @@
PerrorExit(TRUE, "Can't write headers");
/* Write the article and exit. */
- if (fwrite((POINTER)article, (SIZE_T)1, Length, stdout) != Length)
+ if (fwrite((POINTER)article, (size_t)1, Length, stdout) != Length)
PerrorExit(TRUE, "Can't write article");
SafeFlush(stdout);
QuitServer(0);
diff -Naur --recursive inn2-2.3.1.orig/frontends/rnews.c inn2-2.3.1/frontends/rnews.c
--- inn2-2.3.1.orig/frontends/rnews.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/frontends/rnews.c Fri Jun 8 19:32:21 2001
@@ -85,7 +85,7 @@
{
int pan[2];
int i;
- PID_T pid;
+ pid_t pid;
/* Create a pipe. */
if (pipe(pan) < 0) {
@@ -144,7 +144,7 @@
WaitForChildren(i)
register int i;
{
- register PID_T pid;
+ register pid_t pid;
int status;
while (--i >= 0) {
@@ -202,7 +202,7 @@
return;
}
i = strlen(article);
- if (fwrite((POINTER)article, (SIZE_T)1, (SIZE_T)i, F) != i)
+ if (fwrite((POINTER)article, (size_t)1, (size_t)i, F) != i)
syslog(L_ERROR, "cant fwrite %s %m", buff);
if (fclose(F) == EOF)
syslog(L_ERROR, "cant close %s %m", buff);
@@ -737,7 +737,7 @@
}
/* Write out what we read. */
for (count += i, p = buff; i; p += j, i -= j)
- if ((j = write(spfd, (POINTER)p, (SIZE_T)i)) <= 0) {
+ if ((j = write(spfd, (POINTER)p, (size_t)i)) <= 0) {
syslog(L_FATAL, "cant write around %d %m", count);
status++;
break;
diff -Naur --recursive inn2-2.3.1.orig/include/clibrary.h inn2-2.3.1/include/clibrary.h
--- inn2-2.3.1.orig/include/clibrary.h Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/include/clibrary.h Fri Jun 8 19:31:13 2001
@@ -209,23 +209,11 @@
just assuming works. */
typedef void * POINTER;
typedef const void * CPOINTER;
-typedef size_t SIZE_T;
-typedef uid_t UID_T;
-typedef gid_t GID_T;
-typedef pid_t PID_T;
/* Some functions like accept() and getsockopt() take a pointer to a size_t
on some platforms and a pointer to an int on others. Just always using
size_t should work most everywhere. */
#define ARGTYPE socklen_t
-
-/* These are in C9X, and autoconf makes sure they exist, so again occurances
- of the typedefs should be replaced by the standard type. */
-typedef int32_t INT32_T;
-typedef uint32_t U_INT32_T;
-
-/* autoconf deals with these; just use them directly. */
-typedef caddr_t MMAP_PTR;
/* Return type of signal handlers. autoconf defines RETSIGTYPE for this
purpose; use that instead. */
diff -Naur --recursive inn2-2.3.1.orig/include/md5.h inn2-2.3.1/include/md5.h
--- inn2-2.3.1.orig/include/md5.h Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/include/md5.h Fri Jun 8 19:31:13 2001
@@ -71,11 +71,11 @@
/* MD5_CHUNKSIZE must be a power of 2 - fixed value defined by the algorithm */
#define MD5_CHUNKSIZE (1<<6)
-#define MD5_CHUNKWORDS (MD5_CHUNKSIZE/sizeof(U_INT32_T))
+#define MD5_CHUNKWORDS (MD5_CHUNKSIZE/sizeof(uint32_t))
/* MD5_DIGESTSIZE is a the length of the digest as defined by the algorithm */
#define MD5_DIGESTSIZE (16)
-#define MD5_DIGESTWORDS (MD5_DIGESTSIZE/sizeof(U_INT32_T))
+#define MD5_DIGESTWORDS (MD5_DIGESTSIZE/sizeof(uint32_t))
/* MD5_LOW - where low 32 bits of 64 bit count is stored during final */
#define MD5_LOW 14
@@ -92,19 +92,19 @@
/* MD5_READSIZE must be a multiple of MD5_CHUNKSIZE >= MD5_MAXBLOCK */
#define MD5_READSIZE (MD5_CHUNKSIZE<<9)
-#define MD5_READWORDS (MD5_READSIZE/sizeof(U_INT32_T))
+#define MD5_READWORDS (MD5_READSIZE/sizeof(uint32_t))
/* maximum size of pre_file that is used <= MD5_MAXBLOCK */
#define MD5_MAX_PRE_FILE MD5_MAXBLOCK
/*
- * MD5COUNT(MD5_CTX*, U_INT32_T) - update the 64 bit count in an MD5_CTX
+ * MD5COUNT(MD5_CTX*, uint32_t) - update the 64 bit count in an MD5_CTX
*
* We will count bytes and convert to bit count during the final
* transform.
*/
#define MD5COUNT(md5info, count) { \
- U_INT32_T tmp_countLo; \
+ uint32_t tmp_countLo; \
tmp_countLo = (md5info)->countLo; \
if (((md5info)->countLo += (count)) < tmp_countLo) { \
(md5info)->countHi++; \
@@ -121,15 +121,15 @@
*/
typedef struct {
BYTE digest[MD5_DIGESTSIZE]; /* actual digest after MD5Final call */
- U_INT32_T countLo; /* 64 bit count: bits 3-34 */
- U_INT32_T countHi; /* 64 bit count: bits 35-63 (64-66 ignored) */
- U_INT32_T datalen; /* length of data in inp.inp_BYTE */
- U_INT32_T sub_block; /* length of current partial block or 0 */
+ uint32_t countLo; /* 64 bit count: bits 3-34 */
+ uint32_t countHi; /* 64 bit count: bits 35-63 (64-66 ignored) */
+ uint32_t datalen; /* length of data in inp.inp_BYTE */
+ uint32_t sub_block; /* length of current partial block or 0 */
union {
BYTE inp_BYTE[MD5_CHUNKSIZE]; /* BYTE chunk buffer */
- U_INT32_T inp_ULONG[MD5_CHUNKWORDS]; /* U_INT32_T chunk buffer */
+ uint32_t inp_ULONG[MD5_CHUNKWORDS]; /* uint32_t chunk buffer */
} inp;
- U_INT32_T buf[MD5_DIGESTWORDS]; /* scratch buffer */
+ uint32_t buf[MD5_DIGESTWORDS]; /* scratch buffer */
} MD5_CTX;
#define in_byte inp.inp_BYTE
#define in_ulong inp.inp_ULONG
@@ -175,7 +175,7 @@
/* md5io.c */
void MD5Stream P((BYTE*, UINT, FILE*, MD5_CTX*));
void MD5File P((BYTE*, UINT, char*, int, MD5_CTX*));
-extern U_INT32_T md5_zero[];
+extern uint32_t md5_zero[];
/*
* Some external programs use the functions found in md5.c and md5io.c.
diff -Naur --recursive inn2-2.3.1.orig/innd/art.c inn2-2.3.1/innd/art.c
--- inn2-2.3.1.orig/innd/art.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/art.c Fri Jun 8 19:32:25 2001
@@ -674,7 +674,7 @@
return NULL;
}
hp->Length = i;
- (void)memcpy((POINTER)hp->Value, (POINTER)p, (SIZE_T)i);
+ (void)memcpy((POINTER)hp->Value, (POINTER)p, (size_t)i);
hp->Value[i] = '\0';
return in;
diff -Naur --recursive inn2-2.3.1.orig/innd/cc.c inn2-2.3.1/innd/cc.c
--- inn2-2.3.1.orig/innd/cc.c Fri Jun 8 19:35:12 2001
+++ inn2-2.3.1/innd/cc.c Fri Jun 8 19:32:27 2001
@@ -1072,7 +1072,7 @@
if (CTYPE(isupper, Rest[0]))
Rest[0] = tolower(Rest[0]);
}
- if (strlen(Name) + strlen(Rest) > (SIZE_T)(SMBUF - 24))
+ if (strlen(Name) + strlen(Rest) > (size_t)(SMBUF - 24))
return "1 Name too long";
if ((ngp = NGfind(Name)) != NULL)
diff -Naur --recursive inn2-2.3.1.orig/innd/chan.c inn2-2.3.1/innd/chan.c
--- inn2-2.3.1.orig/innd/chan.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/chan.c Fri Jun 8 19:32:33 2001
@@ -73,7 +73,7 @@
}
/* Try to test for non-overlapping copies. */
- memmove((POINTER)bp->Data, (POINTER)p, (SIZE_T)length);
+ memmove((POINTER)bp->Data, (POINTER)p, (size_t)length);
}
bp->Used = 0;
}
@@ -145,7 +145,7 @@
CHANtablesize = i;
CHANtable = NEW(CHANNEL, CHANtablesize);
(void)memset((POINTER)CHANtable, 0,
- (SIZE_T)(CHANtablesize * sizeof *CHANtable));
+ (size_t)(CHANtablesize * sizeof *CHANtable));
CHANnull.NextLog = innconf->chaninacttime;
CHANnull.Address.s_addr = MyAddress.s_addr;
for (cp = CHANtable; --i >= 0; cp++)
@@ -363,7 +363,7 @@
int i;
SITE *sp;
STRING p;
- PID_T pid;
+ pid_t pid;
switch (cp->Type) {
default:
@@ -678,14 +678,14 @@
do {
/* Try the standard case -- write it all. */
- i = write(fd, (POINTER)p, (SIZE_T)length);
+ i = write(fd, (POINTER)p, (size_t)length);
if (i > 0 || (i < 0 && errno != EMSGSIZE && errno != EINTR))
return i;
} while (i < 0 && errno == EINTR);
/* Write it in pieces. */
for (save = p, i = 0; length; p += i, length -= i) {
- i = write(fd, (POINTER)p, (SIZE_T)(length > BUFSIZ ? BUFSIZ : length));
+ i = write(fd, (POINTER)p, (size_t)(length > BUFSIZ ? BUFSIZ : length));
if (i <= 0)
break;
}
diff -Naur --recursive inn2-2.3.1.orig/innd/icd.c inn2-2.3.1/innd/icd.c
--- inn2-2.3.1.orig/innd/icd.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/icd.c Fri Jun 8 19:32:36 2001
@@ -32,7 +32,7 @@
(iovp)->iov_len = len;
(iovp)->iov_base = NEW(char, (iovp)->iov_len);
(void)memcpy((POINTER)(iovp)->iov_base, (POINTER)base,
- (SIZE_T)(iovp)->iov_len);
+ (size_t)(iovp)->iov_len);
}
#define ICDiovrelease(iovp) DISPOSE((iovp)->iov_base)
@@ -285,7 +285,7 @@
BOOL ret;
/* Set up the scatter/gather vectors. */
- if (strlen(Name) + strlen(Rest) > (SIZE_T)(SMBUF - 24)) {
+ if (strlen(Name) + strlen(Rest) > (size_t)(SMBUF - 24)) {
syslog(L_ERROR, "%s too_long %s", LogName, MaxLength(Name, Name));
return FALSE;
}
diff -Naur --recursive inn2-2.3.1.orig/innd/innd.c inn2-2.3.1/innd/innd.c
--- inn2-2.3.1.orig/innd/innd.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/innd.c Fri Jun 8 19:31:13 2001
@@ -62,8 +62,8 @@
STATIC char *ERRLOG = NULL;
STATIC char *LOG = NULL;
STATIC char *PID = NULL;
-STATIC UID_T NewsUID;
-STATIC GID_T NewsGID;
+STATIC uid_t NewsUID;
+STATIC gid_t NewsGID;
@@ -242,7 +242,7 @@
** Spawn a process, with I/O redirected as needed. Return the PID or -1
** (and a syslog'd message) on error.
*/
-PID_T
+pid_t
Spawn(niceval, fd0, fd1, fd2, av)
int niceval;
int fd0;
@@ -252,7 +252,7 @@
{
static char NOCLOSE[] = "%s cant close %d in %s %m";
static char NODUP2[] = "%s cant dup2 %d to %d in %s %m";
- PID_T i;
+ pid_t i;
/* Fork; on error, give up. If not using the patched dbz, make
* this call fork! */
@@ -567,7 +567,7 @@
BOOL ShouldRenumber;
BOOL ShouldSyntaxCheck;
BOOL val;
- PID_T pid;
+ pid_t pid;
#if defined(_DEBUG_MALLOC_INC)
union malloptarg m;
#endif /* defined(_DEBUG_MALLOC_INC) */
@@ -860,7 +860,7 @@
PID = COPY(cpcatpath(innconf->pathrun, _PATH_SERVERPID));
if ((F = fopen(PID, "r")) != NULL) {
if (fgets(buff, sizeof buff, F) != NULL
- && ((pid = (PID_T) atol(buff)) > 0)
+ && ((pid = (pid_t) atol(buff)) > 0)
&& (kill(pid, 0) > 0 || errno != ESRCH)) {
(void)syslog(L_FATAL, "%s already_running pid %ld", LogName,
(long) pid);
diff -Naur --recursive inn2-2.3.1.orig/innd/innd.h inn2-2.3.1/innd/innd.h
--- inn2-2.3.1.orig/innd/innd.h Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/innd.h Fri Jun 8 19:31:13 2001
@@ -297,7 +297,7 @@
BOOL FNLwantsnames;
BUFFER FNLnames;
int Process;
- PID_T pid;
+ pid_t pid;
long Flushpoint;
BUFFER Buffer;
BOOL Buffered;
@@ -322,7 +322,7 @@
*/
typedef struct _PROCESS {
PROCSTATE State;
- PID_T Pid;
+ pid_t Pid;
int Status;
time_t Started;
time_t Collected;
@@ -488,7 +488,7 @@
extern BOOL NeedShell();
extern char **CommaSplit();
extern char *MaxLength();
-extern PID_T Spawn();
+extern pid_t Spawn();
extern NORETURN CleanupAndExit();
extern void FileGlue();
extern void JustCleanup();
diff -Naur --recursive inn2-2.3.1.orig/innd/nc.c inn2-2.3.1/innd/nc.c
--- inn2-2.3.1.orig/innd/nc.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/nc.c Fri Jun 8 19:32:38 2001
@@ -1174,7 +1174,7 @@
** would require changes to the bp structure and
** the way it is used.
*/
- (void)memmove((POINTER)bp->Data, (POINTER)&bp->Data[cp->Rest], (SIZE_T)bp->Used);
+ (void)memmove((POINTER)bp->Data, (POINTER)&bp->Data[cp->Rest], (size_t)bp->Used);
cp->Rest = cp->Lastch = 0;
} else {
bp->Used = cp->Lastch = 0;
diff -Naur --recursive inn2-2.3.1.orig/innd/newsfeeds.c inn2-2.3.1/innd/newsfeeds.c
--- inn2-2.3.1.orig/innd/newsfeeds.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/newsfeeds.c Fri Jun 8 19:32:42 2001
@@ -262,8 +262,8 @@
if (subbed) {
/* Read the subscription patterns and set the bits. */
- (void)memset((POINTER)subbed, SUB_DEFAULT, (SIZE_T)nGroups);
- (void)memset((POINTER)poison, SUB_DEFAULT, (SIZE_T)nGroups);
+ (void)memset((POINTER)subbed, SUB_DEFAULT, (size_t)nGroups);
+ (void)memset((POINTER)poison, SUB_DEFAULT, (size_t)nGroups);
if (ME.Patterns)
SITEsetlist(ME.Patterns, subbed, poison, &ME.PoisonEntry);
SITEsetlist(sp->Patterns, subbed, poison, &sp->PoisonEntry);
@@ -625,7 +625,7 @@
for (strings = SITEreadfile(FALSE), nSites = 0; strings[nSites]; nSites++)
continue;
Sites = NEW(SITE, nSites);
- (void)memset((POINTER)Sites, '\0', (SIZE_T)(nSites * sizeof(SITE)));
+ (void)memset((POINTER)Sites, '\0', (size_t)(nSites * sizeof(SITE)));
/* Set up scratch subscription list. */
subbed = NEW(char, nGroups);
diff -Naur --recursive inn2-2.3.1.orig/innd/ng.c inn2-2.3.1/innd/ng.c
--- inn2-2.3.1.orig/innd/ng.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/ng.c Fri Jun 8 19:32:46 2001
@@ -100,12 +100,12 @@
ngp->NameLength = i;
ngp->Name = &NGnames.Data[NGnames.Used];
- (void)strncpy(ngp->Name, p, (SIZE_T)i);
+ (void)strncpy(ngp->Name, p, (size_t)i);
ngp->Name[i] = '\0';
NGnames.Used += i + 1;
ngp->Dir = &NGdirs.Data[NGdirs.Used];
- (void)strncpy(ngp->Dir, p, (SIZE_T)i);
+ (void)strncpy(ngp->Dir, p, (size_t)i);
ngp->Dir[i] = '\0';
NGdirs.Used += i + 1;
NGdirname(ngp->Dir);
@@ -230,7 +230,7 @@
/* Sort each bucket. */
for (i = NGH_SIZE, htp = NGHtable; --i >= 0; htp++)
if (htp->Used > 1)
- qsort((POINTER)htp->Groups, (SIZE_T)htp->Used,
+ qsort((POINTER)htp->Groups, (size_t)htp->Used,
sizeof htp->Groups[0], NGcompare);
/* Chase down any alias flags. */
diff -Naur --recursive inn2-2.3.1.orig/innd/proc.c inn2-2.3.1/innd/proc.c
--- inn2-2.3.1.orig/innd/proc.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/proc.c Fri Jun 8 19:31:13 2001
@@ -24,7 +24,7 @@
int status;
register PROCESS *pp;
register int i;
- register PID_T pid;
+ register pid_t pid;
for ( ; ; ) {
pid = waitnb(&status);
@@ -133,7 +133,7 @@
*/
int
PROCwatch(pid, site)
- PID_T pid;
+ pid_t pid;
int site;
{
register PROCESS *pp;
diff -Naur --recursive inn2-2.3.1.orig/innd/rc.c inn2-2.3.1/innd/rc.c
--- inn2-2.3.1.orig/innd/rc.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/rc.c Fri Jun 8 19:32:48 2001
@@ -20,7 +20,7 @@
#endif
#define COPYADDR(dest, src) \
- (void)memcpy((POINTER)dest, (POINTER)src, (SIZE_T)sizeof (INADDR))
+ (void)memcpy((POINTER)dest, (POINTER)src, (size_t)sizeof (INADDR))
#define TEST_CONFIG(a, b) \
{ \
diff -Naur --recursive inn2-2.3.1.orig/innd/site.c inn2-2.3.1/innd/site.c
--- inn2-2.3.1.orig/innd/site.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/site.c Fri Jun 8 19:32:53 2001
@@ -194,7 +194,7 @@
}
while(sp->Channel->Out.Left > 0) {
i = write(fd, (POINTER) &sp->Channel->Out.Data[sp->Channel->Out.Used],
- (SIZE_T) sp->Channel->Out.Left);
+ (size_t) sp->Channel->Out.Left);
if(i <= 0) {
syslog(L_ERROR,"%s cant spool count %d",CHANname(sp->Channel),
sp->Channel->Out.Left);
@@ -252,7 +252,7 @@
int j;
if (bp->Left == 0)
return;
- j = write(cp->fd, (POINTER)&bp->Data[bp->Used], (SIZE_T)bp->Left);
+ j = write(cp->fd, (POINTER)&bp->Data[bp->Used], (size_t)bp->Left);
if (j > 0) {
bp->Left -= j;
bp->Used += j;
@@ -572,7 +572,7 @@
*/
STATIC BOOL SITEstartprocess(SITE *sp)
{
- PID_T i;
+ pid_t i;
STRING argv[MAX_BUILTIN_ARGV];
char *process;
int *ip;
diff -Naur --recursive inn2-2.3.1.orig/innd/tcl.c inn2-2.3.1/innd/tcl.c
--- inn2-2.3.1.orig/innd/tcl.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innd/tcl.c Fri Jun 8 19:31:13 2001
@@ -84,15 +84,15 @@
*/
static
-U_INT32_T
+uint32_t
makechecksum(sumbuf, buflen)
u_char *sumbuf;
int buflen;
{
register u_char *buf = (u_char *)sumbuf;
- register INT32_T len = buflen;
- register INT32_T sum;
- U_INT32_T bwordl,bwordr,bword,suml,sumr;
+ register int32_t len = buflen;
+ register int32_t sum;
+ uint32_t bwordl,bwordr,bword,suml,sumr;
int rmdr;
u_char tbuf[4];
u_char *ptbuf;
diff -Naur --recursive inn2-2.3.1.orig/innfeed/malloc.c inn2-2.3.1/innfeed/malloc.c
--- inn2-2.3.1.orig/innfeed/malloc.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/innfeed/malloc.c Fri Jun 8 19:32:58 2001
@@ -117,7 +117,7 @@
POINTER
malloc(nbytes)
- register SIZE_T nbytes;
+ register size_t nbytes;
{
register union overhead *p;
register int bucket = 0;
@@ -287,7 +287,7 @@
POINTER
realloc(cp, nbytes)
POINTER cp;
- SIZE_T nbytes;
+ size_t nbytes;
{
register u_int onb;
union overhead *op;
@@ -409,8 +409,8 @@
POINTER
calloc(num, size)
- SIZE_T num;
- register SIZE_T size;
+ size_t num;
+ register size_t size;
{
register void *p;
diff -Naur --recursive inn2-2.3.1.orig/lib/dbz.c inn2-2.3.1/lib/dbz.c
--- inn2-2.3.1.orig/lib/dbz.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/dbz.c Fri Jun 8 19:31:13 2001
@@ -707,7 +707,7 @@
DISPOSE(tab->core);
if (tab->incore == INCORE_MMAP) {
#if defined(HAVE_MMAP)
- if (munmap((MMAP_PTR) tab->core, (int)conf.tsize * tab->reclen) == -1) {
+ if (munmap((caddr_t) tab->core, (int)conf.tsize * tab->reclen) == -1) {
DEBUG(("closehashtable: munmap failed\n"));
}
#else
diff -Naur --recursive inn2-2.3.1.orig/lib/findheader.c inn2-2.3.1/lib/findheader.c
--- inn2-2.3.1.orig/lib/findheader.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/findheader.c Fri Jun 8 19:33:01 2001
@@ -25,7 +25,7 @@
if (HeaderLen+1<Article+ArtLen-p
&& p[HeaderLen] == ':'
&& ISWHITE(p[HeaderLen + 1])
- && caseEQn(p, Header, (SIZE_T)HeaderLen)) {
+ && caseEQn(p, Header, (size_t)HeaderLen)) {
p += HeaderLen + 2;
while (1) {
for (; p < Article + ArtLen && ISWHITE(*p); p++)
diff -Naur --recursive inn2-2.3.1.orig/lib/inndcomm.c inn2-2.3.1/lib/inndcomm.c
--- inn2-2.3.1.orig/lib/inndcomm.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/inndcomm.c Fri Jun 8 19:31:13 2001
@@ -155,7 +155,7 @@
/*
** Get the server's pid.
*/
-STATIC PID_T
+STATIC pid_t
ICCserverpid()
{
pid_t pid;
@@ -179,7 +179,7 @@
*/
STATIC BOOL
ICCserveralive(pid)
- PID_T pid;
+ pid_t pid;
{
if (kill(pid, 0) > 0 || errno != ESRCH)
return TRUE;
@@ -214,7 +214,7 @@
int len;
FDSET Rmask;
struct timeval T;
- PID_T pid;
+ pid_t pid;
ICC_MSGLENTYPE rlen ;
ICC_PROTOCOLTYPE protocol ;
diff -Naur --recursive inn2-2.3.1.orig/lib/malloc.c inn2-2.3.1/lib/malloc.c
--- inn2-2.3.1.orig/lib/malloc.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/malloc.c Fri Jun 8 19:33:05 2001
@@ -115,7 +115,7 @@
#endif
#endif
-POINTER malloc(SIZE_T nbytes)
+POINTER malloc(size_t nbytes)
{
union overhead *p;
int bucket = 0;
@@ -278,7 +278,7 @@
*/
int reall_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */
-POINTER realloc(POINTER cp, SIZE_T nbytes)
+POINTER realloc(POINTER cp, size_t nbytes)
{
u_int onb;
union overhead *op;
diff -Naur --recursive inn2-2.3.1.orig/lib/md5.c inn2-2.3.1/lib/md5.c
--- inn2-2.3.1.orig/lib/md5.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/md5.c Fri Jun 8 19:31:13 2001
@@ -96,7 +96,7 @@
#define S13 17
#define S14 22
#define FF(a, b, c, d, x, s, ac) \
- {(a) += F((b), (c), (d)) + (x) + (U_INT32_T)(ac); \
+ {(a) += F((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROT((a), (s)); \
(a) += (b); \
}
@@ -105,7 +105,7 @@
#define S23 14
#define S24 20
#define GG(a, b, c, d, x, s, ac) \
- {(a) += G((b), (c), (d)) + (x) + (U_INT32_T)(ac); \
+ {(a) += G((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROT((a), (s)); \
(a) += (b); \
}
@@ -114,7 +114,7 @@
#define S33 16
#define S34 23
#define HH(a, b, c, d, x, s, ac) \
- {(a) += H((b), (c), (d)) + (x) + (U_INT32_T)(ac); \
+ {(a) += H((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROT((a), (s)); \
(a) += (b); \
}
@@ -123,15 +123,15 @@
#define S43 15
#define S44 21
#define II(a, b, c, d, x, s, ac) \
- {(a) += I((b), (c), (d)) + (x) + (U_INT32_T)(ac); \
+ {(a) += I((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROT((a), (s)); \
(a) += (b); \
}
/* forward declaration */
-static void MD5Transform P((U_INT32_T*, U_INT32_T*));
+static void MD5Transform P((uint32_t*, uint32_t*));
#if INN_BYTE_ORDER == INN_BIG_ENDIAN || defined(INN_MUST_ALIGN)
-static U_INT32_T in[MD5_CHUNKWORDS];
+static uint32_t in[MD5_CHUNKWORDS];
#endif
@@ -146,10 +146,10 @@
MD5_CTX *md5Ctx;
{
/* load magic initialization constants */
- md5Ctx->buf[0] = (U_INT32_T)0x67452301;
- md5Ctx->buf[1] = (U_INT32_T)0xefcdab89;
- md5Ctx->buf[2] = (U_INT32_T)0x98badcfe;
- md5Ctx->buf[3] = (U_INT32_T)0x10325476;
+ md5Ctx->buf[0] = (uint32_t)0x67452301;
+ md5Ctx->buf[1] = (uint32_t)0xefcdab89;
+ md5Ctx->buf[2] = (uint32_t)0x98badcfe;
+ md5Ctx->buf[3] = (uint32_t)0x10325476;
/* Initialise bit count */
md5Ctx->countLo = 0L;
@@ -171,9 +171,9 @@
BYTE *inBuf;
UINT count;
{
- U_INT32_T datalen = md5Ctx->datalen;
+ uint32_t datalen = md5Ctx->datalen;
#if INN_BYTE_ORDER == INN_BIG_ENDIAN
- U_INT32_T tmp;
+ uint32_t tmp;
int cnt;
#endif
@@ -183,7 +183,7 @@
if (datalen > 0) {
/* determine the size we need to copy */
- U_INT32_T cpylen = MD5_CHUNKSIZE - datalen;
+ uint32_t cpylen = MD5_CHUNKSIZE - datalen;
/* case: new data will not fill the inBuf */
if (cpylen > count) {
@@ -249,7 +249,7 @@
UINT count;
{
#if INN_BYTE_ORDER == INN_BIG_ENDIAN
- U_INT32_T tmp;
+ uint32_t tmp;
int cnt;
#endif
@@ -269,11 +269,11 @@
MD5Transform(md5Ctx->buf, in);
#else
#if INN_BYTE_ORDER == INN_LITTLE_ENDIAN
- MD5Transform(md5Ctx->buf, (U_INT32_T *)inBuf);
+ MD5Transform(md5Ctx->buf, (uint32_t *)inBuf);
#else
/* byte swap data into little endian order */
for (cnt=0; cnt < MD5_CHUNKWORDS; ++cnt) {
- tmp = (((U_INT32_T *)inBuf)[cnt] << 16) | (((U_INT32_T *)inBuf)[cnt] >> 16);
+ tmp = (((uint32_t *)inBuf)[cnt] << 16) | (((uint32_t *)inBuf)[cnt] >> 16);
in[cnt] = ((tmp & 0xFF00FF00L) >> 8) | ((tmp & 0x00FF00FFL) << 8);
}
MD5Transform(md5Ctx->buf, in);
@@ -297,10 +297,10 @@
{
UINT padLen;
int count = md5Ctx->datalen;
- U_INT32_T lowBitcount = md5Ctx->countLo;
- U_INT32_T highBitcount = md5Ctx->countHi;
+ uint32_t lowBitcount = md5Ctx->countLo;
+ uint32_t highBitcount = md5Ctx->countHi;
#if INN_BYTE_ORDER == INN_BIG_ENDIAN
- U_INT32_T tmp;
+ uint32_t tmp;
UINT i, ii;
#endif
@@ -339,10 +339,10 @@
*/
static void
MD5Transform(buf, in)
- U_INT32_T *buf;
- U_INT32_T *in;
+ uint32_t *buf;
+ uint32_t *in;
{
- U_INT32_T a = buf[0], b = buf[1], c = buf[2], d = buf[3];
+ uint32_t a = buf[0], b = buf[1], c = buf[2], d = buf[3];
/* Round 1 */
FF( a, b, c, d, in[ 0], S11, 3614090360UL); /* 1 */
diff -Naur --recursive inn2-2.3.1.orig/lib/qio.c inn2-2.3.1/lib/qio.c
--- inn2-2.3.1.orig/lib/qio.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/qio.c Fri Jun 8 19:33:10 2001
@@ -82,7 +82,7 @@
if (lseek(qp->fd, (OFFSET_T) 0, SEEK_SET) == -1)
return -1;
- i = read(qp->fd, qp->Buffer, (SIZE_T)qp->Size);
+ i = read(qp->fd, qp->Buffer, (size_t)qp->Size);
if (i < 0)
return i;
qp->Count = i;
@@ -108,7 +108,7 @@
if (qp->End > qp->Start) {
/* Find the newline. */
- p = memchr((POINTER)qp->Start,'\n',(SIZE_T)(qp->End - qp->Start));
+ p = memchr((POINTER)qp->Start,'\n',(size_t)(qp->End - qp->Start));
if (p != NULL) {
*p = '\0';
qp->Length = p - qp->Start;
@@ -126,7 +126,7 @@
p = qp->Buffer;
/* Read data, reset the pointers. */
- i = read(qp->fd, p, (SIZE_T)(&qp->Buffer[qp->Size] - p));
+ i = read(qp->fd, p, (size_t)(&qp->Buffer[qp->Size] - p));
if (i < 0) {
qp->flag = QIO_error;
return NULL;
@@ -140,7 +140,7 @@
qp->End = &p[i];
/* Now try to find it. */
- p = memchr((POINTER)qp->Start, '\n', (SIZE_T)(qp->End - qp->Start));
+ p = memchr((POINTER)qp->Start, '\n', (size_t)(qp->End - qp->Start));
if (p != NULL) {
*p = '\0';
qp->Length = p - qp->Start;
diff -Naur --recursive inn2-2.3.1.orig/lib/readin.c inn2-2.3.1/lib/readin.c
--- inn2-2.3.1.orig/lib/readin.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/readin.c Fri Jun 8 19:33:13 2001
@@ -21,7 +21,7 @@
int count;
for ( ; i; p += count, i -= count)
- if ((count = read(fd, p, (SIZE_T)i)) <= 0)
+ if ((count = read(fd, p, (size_t)i)) <= 0)
return -1;
return 0;
}
diff -Naur --recursive inn2-2.3.1.orig/lib/xwrite.c inn2-2.3.1/lib/xwrite.c
--- inn2-2.3.1.orig/lib/xwrite.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/lib/xwrite.c Fri Jun 8 19:33:15 2001
@@ -15,7 +15,7 @@
int c;
for ( ; i; p += c, i -= c)
- if ((c = write(fd, (POINTER)p, (SIZE_T)i)) <= 0)
+ if ((c = write(fd, (POINTER)p, (size_t)i)) <= 0)
return -1;
return 0;
}
diff -Naur --recursive inn2-2.3.1.orig/nnrpd/commands.c inn2-2.3.1/nnrpd/commands.c
--- inn2-2.3.1.orig/nnrpd/commands.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/nnrpd/commands.c Fri Jun 8 19:31:13 2001
@@ -82,7 +82,7 @@
{
char path[BIG_BUFFER], *fields[6], *p;
int i, pan[2], status;
- PID_T pid;
+ pid_t pid;
struct stat stb;
av += 2;
diff -Naur --recursive inn2-2.3.1.orig/nnrpd/nnrpd.c inn2-2.3.1/nnrpd/nnrpd.c
--- inn2-2.3.1.orig/nnrpd/nnrpd.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/nnrpd/nnrpd.c Fri Jun 8 19:33:19 2001
@@ -386,14 +386,14 @@
/* We have many addresses */
for (pp = hp->h_addr_list; *pp; pp++)
if (memcmp((POINTER)&ap->s_addr, (POINTER)*pp,
- (SIZE_T)hp->h_length) == 0)
+ (size_t)hp->h_length) == 0)
break;
if (*pp == NULL)
return FALSE;
#else
/* We have one address. */
if (memcmp((POINTER)&ap->s_addr, (POINTER)hp->h_addr,
- (SIZE_T)hp->h_length) != 0)
+ (size_t)hp->h_length) != 0)
return FALSE;
#endif
@@ -753,16 +753,16 @@
ARGTYPE clen;
struct sockaddr_in ssa, csa;
struct stat Sb;
- PID_T pid = -1;
- GID_T NewsGID;
- UID_T NewsUID;
+ pid_t pid = -1;
+ gid_t NewsGID;
+ uid_t NewsUID;
int one = 1;
FILE *pidfile;
struct passwd *pwd;
int clienttimeout;
#if HAVE_GETSPNAM
struct group *grp;
- GID_T shadowgid;
+ gid_t shadowgid;
#endif /* HAVE_GETSPNAM */
#ifdef HAVE_SSL
diff -Naur --recursive inn2-2.3.1.orig/nnrpd/perm.c inn2-2.3.1/nnrpd/perm.c
--- inn2-2.3.1.orig/nnrpd/perm.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/nnrpd/perm.c Fri Jun 8 19:31:13 2001
@@ -1621,7 +1621,7 @@
}
typedef struct _EXECSTUFF {
- PID_T pid;
+ pid_t pid;
int rdfd, errfd, wrfd;
} EXECSTUFF;
@@ -1629,7 +1629,7 @@
{
EXECSTUFF *ret;
int rdfd[2], errfd[2], wrfd[2];
- PID_T pid;
+ pid_t pid;
pipe(rdfd);
pipe(errfd);
diff -Naur --recursive inn2-2.3.1.orig/nnrpd/post.c inn2-2.3.1/nnrpd/post.c
--- inn2-2.3.1.orig/nnrpd/post.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/nnrpd/post.c Fri Jun 8 19:33:25 2001
@@ -641,7 +641,7 @@
}
(void)fprintf(F, "\n");
i = strlen(article);
- if (fwrite((POINTER)article, (SIZE_T)1, (SIZE_T)i, F) != i)
+ if (fwrite((POINTER)article, (size_t)1, (size_t)i, F) != i)
return "Can't send article";
if (FLUSH_ERROR(F)) {
(void)pclose(F);
@@ -848,7 +848,7 @@
/* Write the article body */
i = strlen(article);
- if (fwrite((POINTER)article, (SIZE_T)1, (SIZE_T)i, F) != i) {
+ if (fwrite((POINTER)article, (size_t)1, (size_t)i, F) != i) {
fclose(F);
return CANTSPOOL;
}
diff -Naur --recursive inn2-2.3.1.orig/storage/buffindexed/buffindexed.c inn2-2.3.1/storage/buffindexed/buffindexed.c
--- inn2-2.3.1.orig/storage/buffindexed/buffindexed.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/buffindexed/buffindexed.c Fri Jun 8 19:31:13 2001
@@ -549,7 +549,7 @@
}
if ((ovbuff->bitfield =
mmap((caddr_t) 0, ovbuff->base, ovbuffmode & OV_WRITE ? (PROT_READ | PROT_WRITE) : PROT_READ,
- MAP_SHARED, ovbuff->fd, (off_t) 0)) == (MMAP_PTR) -1) {
+ MAP_SHARED, ovbuff->fd, (off_t) 0)) == (caddr_t) -1) {
syslog(L_ERROR,
"%s: ovinitdisks: mmap for %s offset %d len %d failed: %m",
LocalLogName, ovbuff->path, 0, ovbuff->base);
@@ -1524,7 +1524,7 @@
pagefudge = offset % pagesize;
mmapoffset = offset - pagefudge;
len = pagefudge + OV_BLOCKSIZE;
- if ((addr = mmap((caddr_t) 0, len, PROT_READ, MAP_SHARED, ovbuff->fd, mmapoffset)) == (MMAP_PTR) -1) {
+ if ((addr = mmap((caddr_t) 0, len, PROT_READ, MAP_SHARED, ovbuff->fd, mmapoffset)) == (caddr_t) -1) {
syslog(L_ERROR, "%s: ovgroupmmap could not mmap index block: %m", LocalLogName);
ovgroupunmap();
return FALSE;
@@ -1597,7 +1597,7 @@
pagefudge = offset % pagesize;
mmapoffset = offset - pagefudge;
gdb->len = pagefudge + OV_BLOCKSIZE;
- if ((gdb->addr = mmap((caddr_t) 0, gdb->len, PROT_READ, MAP_SHARED, ovbuff->fd, mmapoffset)) == (MMAP_PTR) -1) {
+ if ((gdb->addr = mmap((caddr_t) 0, gdb->len, PROT_READ, MAP_SHARED, ovbuff->fd, mmapoffset)) == (caddr_t) -1) {
syslog(L_ERROR, "%s: ovgroupmmap could not mmap data block: %m", LocalLogName);
DISPOSE(gdb);
ovgroupunmap();
@@ -1917,7 +1917,7 @@
OVBUFF *ovbuffnext, *ovbuff = ovbufftab;
#ifdef OV_DEBUG
FILE *F = NULL;
- PID_T pid;
+ pid_t pid;
char *path = NULL;
int j;
struct ov_trace_array *trace;
diff -Naur --recursive inn2-2.3.1.orig/storage/cnfs/cnfs-private.h inn2-2.3.1/storage/cnfs/cnfs-private.h
--- inn2-2.3.1.orig/storage/cnfs/cnfs-private.h Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/cnfs/cnfs-private.h Fri Jun 8 19:31:13 2001
@@ -44,7 +44,7 @@
freely available byte */
time_t updated; /* Time of last update to header */
int fd; /* file descriptor for this cycbuff */
- U_INT32_T cyclenum; /* Number of current cycle, 0 = invalid */
+ uint32_t cyclenum; /* Number of current cycle, 0 = invalid */
int magicver; /* Magic version number */
caddr_t bitfield; /* Bitfield for article in use */
CYCBUFF_OFF_T minartoffset; /* The minimum offset allowed for article
diff -Naur --recursive inn2-2.3.1.orig/storage/cnfs/cnfs.c inn2-2.3.1/storage/cnfs/cnfs.c
--- inn2-2.3.1.orig/storage/cnfs/cnfs.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/cnfs/cnfs.c Fri Jun 8 19:31:13 2001
@@ -57,9 +57,9 @@
STATIC int refresh_interval = REFRESH_INTERVAL;
STATIC TOKEN CNFSMakeToken(char *cycbuffname, CYCBUFF_OFF_T offset,
- U_INT32_T cycnum, STORAGECLASS class, TOKEN *oldtoken) {
+ uint32_t cycnum, STORAGECLASS class, TOKEN *oldtoken) {
TOKEN token;
- INT32_T int32;
+ int32_t int32;
if (oldtoken == (TOKEN *)NULL)
memset(&token, '\0', sizeof(token));
@@ -85,8 +85,8 @@
*/
STATIC BOOL CNFSBreakToken(TOKEN token, char *cycbuffname,
- CYCBUFF_OFF_T *offset, U_INT32_T *cycnum) {
- INT32_T int32;
+ CYCBUFF_OFF_T *offset, uint32_t *cycnum) {
+ int32_t int32;
if (cycbuffname == NULL || offset == NULL || cycnum == NULL) {
syslog(L_ERROR, "%s: BreakToken: invalid argument",
@@ -646,7 +646,7 @@
fd = cycbuff->fd;
if ((cycbuff->bitfield =
mmap((caddr_t) 0, cycbuff->minartoffset, SMopenmode ? (PROT_READ | PROT_WRITE) : PROT_READ,
- MAP_SHARED, fd, (off_t) 0)) == (MMAP_PTR) -1 || errno != 0) {
+ MAP_SHARED, fd, (off_t) 0)) == (caddr_t) -1 || errno != 0) {
syslog(L_ERROR,
"%s: CNFSinitdisks: mmap for %s offset %d len %d failed: %m",
LocalLogName, cycbuff->path, 0, cycbuff->minartoffset);
@@ -942,7 +942,7 @@
}
}
-STATIC int CNFSArtMayBeHere(CYCBUFF *cycbuff, CYCBUFF_OFF_T offset, U_INT32_T cycnum) {
+STATIC int CNFSArtMayBeHere(CYCBUFF *cycbuff, CYCBUFF_OFF_T offset, uint32_t cycnum) {
STATIC time_t lastupdate = 0;
CYCBUFF *tmp;
@@ -1070,7 +1070,7 @@
static char buf[1024];
char *artcycbuffname;
CYCBUFF_OFF_T artoffset, middle;
- U_INT32_T artcyclenum;
+ uint32_t artcyclenum;
CNFSARTHEADER cah;
struct iovec iov[2];
int tonextblock;
@@ -1199,7 +1199,7 @@
ARTHANDLE *cnfs_retrieve(const TOKEN token, const RETRTYPE amount) {
char cycbuffname[9];
CYCBUFF_OFF_T offset;
- U_INT32_T cycnum;
+ uint32_t cycnum;
CYCBUFF *cycbuff;
ARTHANDLE *art;
CNFSARTHEADER cah;
@@ -1334,8 +1334,8 @@
pagefudge = offset % pagesize;
mmapoffset = offset - pagefudge;
private->len = pagefudge + ntohl(cah.size);
- if ((private->base = mmap((MMAP_PTR)0, private->len, PROT_READ,
- MAP__ARG, cycbuff->fd, mmapoffset)) == (MMAP_PTR) -1) {
+ if ((private->base = mmap((caddr_t)0, private->len, PROT_READ,
+ MAP__ARG, cycbuff->fd, mmapoffset)) == (caddr_t) -1) {
SMseterror(SMERR_UNDEFINED, "mmap failed");
syslog(L_ERROR, "%s: could not mmap token %s %s:0x%s:%ld: %m",
LocalLogName, TokenToText(token), cycbuffname, CNFSofft2hex(offset, FALSE), cycnum);
@@ -1447,7 +1447,7 @@
BOOL cnfs_cancel(TOKEN token) {
char cycbuffname[9];
CYCBUFF_OFF_T offset;
- U_INT32_T cycnum;
+ uint32_t cycnum;
CYCBUFF *cycbuff;
if (token.type != TOKEN_CNFS) {
@@ -1668,8 +1668,8 @@
pagefudge = offset % pagesize;
mmapoffset = offset - pagefudge;
private->len = pagefudge + ntohl(cah.size);
- if ((private->base = mmap((MMAP_PTR)0, private->len, PROT_READ,
- MAP__ARG, cycbuff->fd, mmapoffset)) == (MMAP_PTR) -1) {
+ if ((private->base = mmap((caddr_t)0, private->len, PROT_READ,
+ MAP__ARG, cycbuff->fd, mmapoffset)) == (caddr_t) -1) {
art->data = NULL;
art->len = 0;
art->token = NULL;
diff -Naur --recursive inn2-2.3.1.orig/storage/ov.c inn2-2.3.1/storage/ov.c
--- inn2-2.3.1.orig/storage/ov.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/ov.c Fri Jun 8 19:33:42 2001
@@ -605,7 +605,7 @@
/* Sort each hash bucket. */
for (i = NGH_SIZE, htp = NGHtable; --i >= 0; htp++)
if (htp->Used > 1)
- qsort((POINTER)htp->Groups, (SIZE_T)htp->Used, sizeof htp->Groups[0],
+ qsort((POINTER)htp->Groups, (size_t)htp->Used, sizeof htp->Groups[0],
NGcompare);
/* Ok, now change our use of the Last field. Set them all to maxint. */
diff -Naur --recursive inn2-2.3.1.orig/storage/timecaf/caf.c inn2-2.3.1/storage/timecaf/caf.c
--- inn2-2.3.1.orig/storage/timecaf/caf.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/timecaf/caf.c Fri Jun 8 19:33:35 2001
@@ -99,7 +99,7 @@
OurRead(fd, buf, n)
int fd;
POINTER buf;
-SIZE_T n;
+size_t n;
{
int rval;
rval = read(fd, buf, n);
@@ -120,7 +120,7 @@
OurWrite(fd, buf, n)
int fd;
CPOINTER buf;
-SIZE_T n;
+size_t n;
{
int rval;
rval = write(fd, buf, n);
@@ -597,7 +597,7 @@
CAFOpenArtRead(path, art, len)
char *path;
ARTNUM art;
-SIZE_T *len;
+size_t *len;
{
CAFHEADER head;
int fd;
@@ -676,7 +676,7 @@
static unsigned int
CAFFindOptimalBlocksize(tocsize, cfsize)
ARTNUM tocsize;
-SIZE_T cfsize;
+size_t cfsize;
{
if (cfsize == 0) return CAF_DEFAULT_BLOCKSIZE; /* no size given, use default. */
@@ -700,7 +700,7 @@
char *cfpath;
ARTNUM artnum;
ARTNUM tocsize;
-SIZE_T estcfsize;
+size_t estcfsize;
int nolink;
char *temppath;
{
@@ -814,7 +814,7 @@
char *path;
ARTNUM *artp;
int waitlock;
-SIZE_T size;
+size_t size;
{
int fd;
@@ -830,7 +830,7 @@
** the *artp? business is so that if *artp==0, we set initial
** article # to 1.
*/
- fd = CAFCreateCAFFile(path, (*artp ? *artp : 1), CAF_DEFAULT_TOC_SIZE, (SIZE_T)0, 0, NULL);
+ fd = CAFCreateCAFFile(path, (*artp ? *artp : 1), CAF_DEFAULT_TOC_SIZE, (size_t)0, 0, NULL);
/*
** XXX possible race condition here, so we check to see if
** create failed because of EEXIST. If so, we go back to top
@@ -883,7 +883,7 @@
CAFStartWriteFd(fd, artp, size)
int fd;
ARTNUM *artp;
-SIZE_T size;
+size_t size;
{
CAFHEADER head;
CAFTOCENT tocent;
@@ -1438,7 +1438,7 @@
unsigned int blocksize;
char *zerobuff;
struct stat statbuf;
- SIZE_T datasize;
+ size_t datasize;
double percentfree;
int toc_needs_expansion;
int toc_needs_compacting;
@@ -1693,7 +1693,7 @@
/* try to create new CAF file with some temp. pathname */
/* note: new CAF file is created in flocked state. */
- if ((fdout = CAFCreateCAFFile(path, newlow, newtocsize, (SIZE_T) statbuf.st_size, 1, newpath)) < 0) {
+ if ((fdout = CAFCreateCAFFile(path, newlow, newtocsize, (size_t) statbuf.st_size, 1, newpath)) < 0) {
(void)fclose(infile);
DISPOSE(tocarray);
DISPOSE(newpath);
diff -Naur --recursive inn2-2.3.1.orig/storage/timecaf/caf.h inn2-2.3.1/storage/timecaf/caf.h
--- inn2-2.3.1.orig/storage/timecaf/caf.h Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/timecaf/caf.h Fri Jun 8 19:34:07 2001
@@ -14,11 +14,11 @@
ARTNUM Low; /* lowest article in the file */
ARTNUM NumSlots; /* number of articles there are room for in the TOC */
ARTNUM High; /* last article actually present in the file */
- SIZE_T Free; /* amount of space currently unused (freed by cancels/expires) */
+ size_t Free; /* amount of space currently unused (freed by cancels/expires) */
OFFSET_T StartDataBlock; /* offset of first article data block. */
unsigned int BlockSize; /* unit of allocation for CAF files. */
- SIZE_T FreeZoneTabSize; /* amount of space taken up by the free zone table. */
- SIZE_T FreeZoneIndexSize; /* size taken up by the "index" part of the free zone table. */
+ size_t FreeZoneTabSize; /* amount of space taken up by the free zone table. */
+ size_t FreeZoneIndexSize; /* size taken up by the "index" part of the free zone table. */
time_t LastCleaned; /* note time of last cleaning. */
int spare[3];
} CAFHEADER;
@@ -70,9 +70,9 @@
typedef struct _CAFBITMAP {
OFFSET_T StartDataBlock;
OFFSET_T MaxDataBlock; /* can only handle offsets < this with this bitmap. */
- SIZE_T FreeZoneTabSize;
- SIZE_T FreeZoneIndexSize;
- SIZE_T BytesPerBMB; /* size of chunk, in bytes, that any given BMBLK can map. */
+ size_t FreeZoneTabSize;
+ size_t FreeZoneIndexSize;
+ size_t BytesPerBMB; /* size of chunk, in bytes, that any given BMBLK can map. */
unsigned int BlockSize;
unsigned int NumBMB; /* size of Blocks array. */
struct _CAFBMB **Blocks;
@@ -93,7 +93,7 @@
typedef struct _CAFTOCENT {
OFFSET_T Offset;
- SIZE_T Size;
+ size_t Size;
time_t ModTime;
} CAFTOCENT;
@@ -120,12 +120,12 @@
#define PROTO(x) ()
#endif
-extern int CAFOpenArtRead PROTO((char *cfpath, ARTNUM art, SIZE_T *len));
-extern int CAFOpenArtWrite PROTO((char *cfpath, ARTNUM *art, int WaitLock, SIZE_T size));
-extern int CAFStartWriteFd PROTO((int fd, ARTNUM *art, SIZE_T size));
+extern int CAFOpenArtRead PROTO((char *cfpath, ARTNUM art, size_t *len));
+extern int CAFOpenArtWrite PROTO((char *cfpath, ARTNUM *art, int WaitLock, size_t size));
+extern int CAFStartWriteFd PROTO((int fd, ARTNUM *art, size_t size));
extern int CAFFinishWriteFd PROTO((int fd));
extern int CAFFinishArtWrite PROTO((int fd));
-extern int CAFCreateCAFFile PROTO((char *cfpath, ARTNUM lowart, ARTNUM tocsize, SIZE_T cfsize, int nolink, char *temppath));
+extern int CAFCreateCAFFile PROTO((char *cfpath, ARTNUM lowart, ARTNUM tocsize, size_t cfsize, int nolink, char *temppath));
extern char *CAFErrorStr PROTO((void));
extern CAFTOCENT *CAFReadTOC PROTO((char *cfpath, CAFHEADER *ch));
extern int CAFRemoveMultArts PROTO((char *cfpath, unsigned int narts, ARTNUM *arts));
diff -Naur --recursive inn2-2.3.1.orig/storage/timecaf/timecaf.c inn2-2.3.1/storage/timecaf/timecaf.c
--- inn2-2.3.1.orig/storage/timecaf/timecaf.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/timecaf/timecaf.c Fri Jun 8 19:33:38 2001
@@ -412,7 +412,7 @@
int fd;
PRIV_TIMECAF *private;
char *p;
- SIZE_T len;
+ size_t len;
ARTHANDLE *art;
static long pagesize = 0;
@@ -460,7 +460,7 @@
delta = curoff % pagesize;
tmpoff = curoff - delta;
private->mmaplen = len + delta;
- if ((private->mmapbase = mmap((MMAP_PTR)0, private->mmaplen, PROT_READ, MAP__ARG, fd, tmpoff)) == (MMAP_PTR)-1) {
+ if ((private->mmapbase = mmap((caddr_t)0, private->mmaplen, PROT_READ, MAP__ARG, fd, tmpoff)) == (caddr_t)-1) {
SMseterror(SMERR_UNDEFINED, NULL);
syslog(L_ERROR, "timecaf: could not mmap article: %m");
DISPOSE(art->private);
diff -Naur --recursive inn2-2.3.1.orig/storage/timehash/timehash.c inn2-2.3.1/storage/timehash/timehash.c
--- inn2-2.3.1.orig/storage/timehash/timehash.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/timehash/timehash.c Fri Jun 8 19:31:13 2001
@@ -215,7 +215,7 @@
art->private = (void *)private;
private->len = sb.st_size;
if (innconf->articlemmap) {
- if ((private->base = mmap((MMAP_PTR)0, sb.st_size, PROT_READ, MAP__ARG, fd, 0)) == (MMAP_PTR)-1) {
+ if ((private->base = mmap((caddr_t)0, sb.st_size, PROT_READ, MAP__ARG, fd, 0)) == (caddr_t)-1) {
SMseterror(SMERR_UNDEFINED, NULL);
syslog(L_ERROR, "timehash: could not mmap article: %m");
DISPOSE(art->private);
diff -Naur --recursive inn2-2.3.1.orig/storage/tradspool/tradspool.c inn2-2.3.1/storage/tradspool/tradspool.c
--- inn2-2.3.1.orig/storage/tradspool/tradspool.c Thu Jan 11 01:55:23 2001
+++ inn2-2.3.1/storage/tradspool/tradspool.c Fri Jun 8 19:31:13 2001
@@ -755,7 +755,7 @@
art->private = (void *)private;
private->artlen = sb.st_size;
if (innconf->articlemmap) {
- if ((private->artbase = mmap((MMAP_PTR)0, sb.st_size, PROT_READ, MAP__ARG, fd, 0)) == (MMAP_PTR)-1) {
+ if ((private->artbase = mmap((caddr_t)0, sb.st_size, PROT_READ, MAP__ARG, fd, 0)) == (caddr_t)-1) {
SMseterror(SMERR_UNDEFINED, NULL);
syslog(L_ERROR, "tradspool: could not mmap article: %m");
DISPOSE(art->private);
More information about the inn-patches
mailing list