supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* ucspilogd compile fails
@ 2004-02-01 12:53 Dean Hall
  2004-02-01 15:24 ` Laurent Bercot
  0 siblings, 1 reply; 3+ messages in thread
From: Dean Hall @ 2004-02-01 12:53 UTC (permalink / raw)


Hi,

ucspilogd 0.35 fails to compile on my machine.

I'm running RedHat 7.3 on a K6-2 500MHz 256MB with:
- kernel 2.4.20-28.7
- gcc 2.96-113 RPM
- glibc (and glibc-devel) 2.2.5-44 RPMs
- skalibs 0.39

Here is (I hope) all relevant output:

----------------------------
root@tethys:ucspilogd-0.35> package/install
# ...
# Errors here:
Making subsystem ucspilogd...
./compile ucspilogd.c
In file included from /usr/include/syslog.h:1,
                  from ucspilogd.c:2:
/usr/include/sys/syslog.h:88: `NULL' undeclared here (not in a function)
/usr/include/sys/syslog.h:88: initializer element is not constant
/usr/include/sys/syslog.h:88: (near initialization for 
`prioritynames[12].c_name')
/usr/include/sys/syslog.h:146: `NULL' undeclared here (not in a function)
/usr/include/sys/syslog.h:146: initializer element is not constant
/usr/include/sys/syslog.h:146: (near initialization for 
`facilitynames[22].c_name')
make: *** [ucspilogd.o] Error 1
----------------------------

Just in case my syslog.h is weird, here are the relevant sections:
----------------------------
#ifdef SYSLOG_NAMES
/* ... */
CODE prioritynames[] =
   {
     /* array entries for each priority name and code here */
     /* line 88: */
     { NULL, -1 }
   };
#endif
----------------------------
#ifdef SYSLOG_NAMES
CODE facilitynames[] =
   {
     /* array entries for each facility name and code here */
     /* line 146: */
     { NULL, -1 }
   };
#endif
----------------------------

Might syslog.h or ucspilogd.c not be including a relevant header file that 
defines the NULL constant/define? It's been a while since I've done C. I 
appreciate any help anyone can give.

Thanks,


Dean


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ucspilogd compile fails
  2004-02-01 12:53 ucspilogd compile fails Dean Hall
@ 2004-02-01 15:24 ` Laurent Bercot
  2004-02-02  2:21   ` Dean Hall
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Bercot @ 2004-02-01 15:24 UTC (permalink / raw)


> In file included from /usr/include/syslog.h:1,
>                  from ucspilogd.c:2:
> /usr/include/sys/syslog.h:88: `NULL' undeclared here (not in a function)

 Okay, so RedHat (or glibc ?) monkeys have made syslog.h
not self-contained. The problem comes from your distribution.
Upgrading may solve it ; if it does not, add a "#include <stdlib.h>"
line at the beginning of /usr/include/syslog.h .
 If you're reluctant to hand-edit a RPM-managed file, adding that line
at the beginning of ucspilogd.c instead should make ucspilogd compile
- but other software may run into the same problem.

-- 
 Ska


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ucspilogd compile fails
  2004-02-01 15:24 ` Laurent Bercot
@ 2004-02-02  2:21   ` Dean Hall
  0 siblings, 0 replies; 3+ messages in thread
From: Dean Hall @ 2004-02-02  2:21 UTC (permalink / raw)


Laurent,

>  Okay, so RedHat (or glibc ?) monkeys have made syslog.h
> not self-contained. The problem comes from your distribution.
> Upgrading may solve it ;

Unfortunately, RedHat isn't doing any errata for RedHat 7.3 any more. I'm 
still looking into doing upgrades via Fedora, but since I'm going to 
switch to another distro soon (Debian, Slackware, or even do my own Linux 
 from scratch), it doesn't seem worth it. I hope to get used to doing 
things the djb way before moving over, though.

> if it does not, add a "#include <stdlib.h>"
> line at the beginning of /usr/include/syslog.h .
>  If you're reluctant to hand-edit a RPM-managed file, adding that line
> at the beginning of ucspilogd.c instead should make ucspilogd compile
> - but other software may run into the same problem.

I added the include line into ucspilogd.c, and it worked great. Thanks! 
Can't wait to get rid of syslogd and klogd....


Dean


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-02  2:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-01 12:53 ucspilogd compile fails Dean Hall
2004-02-01 15:24 ` Laurent Bercot
2004-02-02  2:21   ` Dean Hall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).