Re: [exim-dev] Using log_create() from src/src/log.c

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Phil Pennock
Ημερομηνία:  
Προς: Todd Lyons
Υ/ο: exim-dev
Αντικείμενο: Re: [exim-dev] Using log_create() from src/src/log.c
On 2013-02-07 at 08:42 -0800, Todd Lyons wrote:
> In log.c, there is a function named log_create. You pass it a const
> unsigned string for the filename, it creates the file and passes back
> a file descriptor. The problem I'm having is that the function is not
> declared anywhere. I cannot figure out why building log.c doesn't
> complain, but I do know that it's used only in log.c, nowhere else, no
> doubt that has something to do with it. In my dmarc.c, I have
> included "exim.h" and "functions.h", and I get this error:


> Thinking I was brilliant, I added 'extern const int log_create(uschar
> *);' to my dmarc.c, and it then builds dmarc.o properly. But the
> linking of the exim binary fails:


The function:

    static int
    log_create(uschar *name)
    {
    // ...
    }


See that `static`? Remove it.

Static, at file scope, means only visible to this compilation unit, and
the symbol won't be exported in the .o file to be visible to the linker.

Which I think you knew, but are having one of those blind-spot moments
which ended 10 seconds ago with you wanting a wall to bang your head
against.

Coffee is good.

-Phil