httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: Question on a patch I want to do....
Date Sat, 15 Nov 1997 02:54:04 GMT
Michael Douglass wrote:
> 
> 
> Humor me, and tell me that this will do what I want to do:
> 
> Given this code:
> 
> static void expand_lock_fname(pool *p)
> {
>     char buf[20];
> 
>     ap_snprintf( buf, sizeof(buf), ".%u", getpid() );
>     lock_fname = pstrcat (p, server_root_relative (p, lock_fname), buf, NULL);
> }
> 
> If I change the last line to:
>     lock_fname = pstrcat (p, "/usr/local/locks/apache, buf, NULL);
> 
> It will make the lockfile name /usr/local/locsk/apache.pid, right?
> 

Well, not exactly, since you're missing a " up there after the
locks/apache string.

And that it would make the lockfile /usr/local/locks/apache
and not /usr/local/locsk/apache.pid . But other than that, yep. :)

In other words, the server_root_relative (p, lock_fname) call returns
the lockfile name as configured in the conf files. If you want to
hard code a filename in, then expand_lock_fname is the place to
do it.

-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message