program exits prematurely - added echos to help trace - chttpd

From: Mark Hobley (markhobley_at_hotpop.deletethisbit.com)
Date: 09/18/04


Date: Sat, 18 Sep 2004 13:53:35 GMT

Hello.

I am having some problems with chttpd not running on my computer. I have added
some echo statements to locate the fault.

I have located a section of code that I believe may be of help in solving the
problem:

#else
    printf("daemon chk\n"); /* debug!! - this echos */
    if (daemon( 0, 0)==-1){
        printf("daemon perror\n"); /* debug!! - this does not echo */
        perror("daemon:");
        exit(1);
    }
    printf("eochk daemon\n"); /* debug!! - this does not echo */
#endif
    user_id = UID;
    group_id = GID;
    printf("identifying\n"); /* debug!! - this does not echo */

Unfortunately, I don't know how to use the debugging tools properly at the
moment, because I am used to an MSDOS assembly language environment and
Microsoft Codeview. I haven't yet fully adapted to the linux development
environment.

Anyhow, from what I can tell from the above, I would expect the second or
third echo to work.

Does this mean that the code is exiting prematurely on "if (daemon( 0,0)==-1)"
?

Does anyone know how to fix this, or have any suggestions as to what may be
wrong ?

Thanks in advance to anyone who can help.

Regards,

Mark.

-- 
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE
Reply to: markhobley at hotpop dot do_not_type_this_bit com
http://markhobley.yi.org/


Relevant Pages