mkstemp, libinn and other

Matus "fantomas" Uhlar uhlar at fantomas.sk
Tue Mar 28 14:41:57 UTC 2000


Hello,

so I'm trying to compile newsgate (quite works), patch inn to use mktemp
instead of mkstemp (quite works) but i have problems with both.

1. 

defining USE_PARSEDATE wil cause newsgate to use libinn's parsedate routine.
I tried to #include <libinn.h> to have function prototype.

gcc -g -O2 -Wall -DUSE_PARSEDATE -DHAVE_MKSTEMP
-I/home/news/inn-2.2.2/include -
In file included from /home/news/inn-2.2.2/include/libinn.h:8,
                 from rfc822.c:6:
/home/news/inn-2.2.2/include/storage.h:25: syntax error before `OFFSET_T'
/home/news/inn-2.2.2/include/storage.h:60: syntax error before `IsToken'
/home/news/inn-2.2.2/include/storage.h:60: warning: type defaults to `int' in declaration of `IsToken'

ehm, seems that either libinn.h should include clibrary.h ot I should do it
in rfc822.c; anyway I don't think i should do that...

2.

mkstemp (appears in FreeBSD4.0 and seems it appeared since FreeBSD exists)
takes filename mask and returns opened file descriptor. quite easy in some of
programs but quite hard in library functions they probably need rewrite to
use mkstemp...

There's also function TempName which seems to be useless when mkstemp() is
used.

many functions in libinn use mktemp and pass the result to another one
function. Maybe i should rewrite those functions, if they will get empty
filename, whey will generate temporary file...
any ideas, suggestions, comments ? 

clientactive.c: 
FILE *CAlistopen(FILE *FromServer, FILE *ToServer, char *request)
...
    (void)mktemp(CApathname);
    return CAfp = CA_listopen(CApathname, FromServer, ToServer, request);
...


defdist.c:
struct _DDHANDLE *DDstart(FILE *FromServer, FILE *ToServer)
...
        (void)mktemp(name);
        if ((F = CA_listopen(name, FromServer, ToServer,
                    "distrib.pats")) == NULL)
...


getmodaddr.c:
char *GetModeratorAddress(FILE *FromServer, FILE *ToServer, char *group)
...
        (void)mktemp(GMApathname);
        GMAfp = GMA_listopen(GMApathname, FromServer, ToServer, "moderators");
...


inndcomm.c:
int ICCopen()
...
    (void)mktemp(ICCsockname);
    if (unlink(ICCsockname) < 0 && errno != ENOENT) {
...



and also some functions in inews, rnews, nnrpd that use TempName...
-- 
 Matus "fantomas" Uhlar, sysadmin at NEXTRA, Slovakia; IRCNET admin of *.sk
 uhlar at fantomas.sk ; http://www.fantomas.sk/ ; http://www.nextra.sk/
 "To Boot or not to Boot, that's the question." [WD1270 Caviar]



More information about the inn-workers mailing list