bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cvs-cvs] Changes to ccvs/windows-NT/filesubr.c


From: Derek Price
Subject: Re: [Cvs-cvs] Changes to ccvs/windows-NT/filesubr.c
Date: Tue, 20 Sep 2005 18:07:06 -0400
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Conrad T. Pino wrote:

>H:\cvs-1.12>grep -dn TMPDIR_ENV *.h
>File src\cvs.h:
>258     #define TMPDIR_ENV      "TMPDIR"        /* Temporary directory */
>
>That's not a value ever likely to be defined on Windows.  IMO the Windows
>value should be "TMP" given the Win32 API documentation we've seen.
>  
>

That's why I suggested the wrapper function lookup TMPDIR_ENV on UNIX
and call the Windows gettemppath() function on Windows.

src/filesubr.c:

char *get_system_temp_dir (void)
{
    return xstrdup (getenv (TEMPDIR_ENV));
}

windows-NT/filesubr.c:

char *get_system_temp_dir (void)
{
    return xstrdup (gettemppath());
}

Then, replace the call to getenv in main.c with a call to
get_system_temp_dir.

>This looks pretty easy except Microsoft's "mkdir" has only 1 argument
>and we pick up another "mbsinit" linker error from another module.
>See below for compiler output.
>  
>

What about a rpl_mkdir wrapper in windows-NT/filesubr.c like:

#undef mkdir
extern int mkdir (const char *pathname); /* or include Windows header
with mkdir decl */
int rpl_mkdir (const char *pathname, mode_t mode)
{
    mkdir (pathname);
    /* chmod (pathname)? */
}

>I checked for "fdopen" function and VC6 has one.
>
>Should "cvs_temp_file" stay in the "filesubr.c" module?
>  
>

Not if you can use lib/mkstemp.c.  If you can, I think we should be able
to move cvs_temp_file into src/subr.c and share it.

Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot <http://ximbiot.com>
v: +1 717.579.6168
f: +1 717.234.3125
<mailto:address@hidden>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]