|
Register or have you forgotten your password?
|
|
|
| Alternative Operating Systems This forum is dedicated to discussions of alternatives to the Commodore Amiga Platform, such as Linux distributions, FreeBSD, OpenBSD, and others. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||||||||
|
Kindred of Babble-on
![]()
Join Date: Jul 2006
Location: Tallahassee, FL
Posts: 2,128
|
I'm farting around with UW's imap kit, imap-2006i. I want to have the syslog facility set based on the running service.
Here's the call to server_init() from imap.c: server_init (pgmname,"imap","imaps",clkint,kodint,hupint,trmin t); Here's the function definition from env_unix.c: void server_init (char *server,char *service,char *sslservice, void *clkint,void *kodint,void *hupint,void *trmint) The line I'm trying to get to make work looks like this: openlog (myServerName = cpystr (server), LOG_PID, (service=="imap") ? LOG_LOCAL2 : LOG_LOCAL0); The ternary always returns the false value, LOG_LOCAL0. It's been forever since I did anything useful with C... what am I missing here? |
||||||||
|
|
|
|
|
#2 | ||||||||
|
' union select name,pwd--
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
|
service=="imap" does not compare strings, but string pointers.
look into strcmp. |
||||||||
|
|
|
|
|
#3 | ||||||||
|
Kindred of Babble-on
![]()
Join Date: Jul 2006
Location: Tallahassee, FL
Posts: 2,128
|
Bingo. Darned pointers. I knew I was missing something easy.
Piru, I *knew* you'd have the answer. Thanks! This did it openlog (myServerName = cpystr (server), LOG_PID, strcmp(service,"imap") ? LOG_LOCAL0 : LOG_LOCAL2 ); Now this is fixed, I need to get to bed. Tomorrow I get to figure out what Mark changed in dmail between 2004f and 2006i so I can make port my symlink hack :-D |
||||||||
|
|
|
![]() |
| Bookmarks |
| Tags |
| comparison , question , quick , resolved , string |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quick PSU question | tonyyeb | Amiga Hardware Issues and discussion | 3 | 08-09-2008 06:47 AM |
| Quick OS3.9 question | Everblue | Amiga Hardware Issues and discussion | 1 | 01-13-2008 03:58 PM |
| Quick SFS question | Everblue | Amiga Software Issues and Discussion | 6 | 01-03-2007 08:18 AM |
| Quick pc ram question | Gav | Amiga Hardware Issues and discussion | 13 | 12-08-2006 02:38 PM |
| Quick question: Please help | Bodie | Amiga Hardware Issues and discussion | 9 | 01-27-2003 09:08 AM |