Re: [Cooker] chkconfig segfaults

2002-02-01 Thread Guillaume Cottenceau

Borsenkow Andrej <[EMAIL PROTECTED]> writes:

> buf is variable which address is (to be) taken. I do not know how
> compiler interprets stat in this context. You can't take address of
> structure type name to my best knowledge.

I think it takes address of the (glibc) function.

This:

printf("Address of stat  <%p>\n", &stat);
printf("Address of mknod <%p>\n", &mknod);
printf("Address of mount <%p>\n", &mount);

Gives:

Address of stat  <0x8048540>
Address of mknod <0x8048570>
Address of mount <0x80483c4>


-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/




Re: [Cooker] chkconfig segfaults

2002-01-31 Thread Frederic Lepied

Borsenkow Andrej <[EMAIL PROTECTED]> writes:

> > 
> > fam
> > ##
> > /var/tmp/rpm-tmp.28048: line 1:  2788 Segmentation fault
> > /sbin/chkconfig --add xinetd
> > error: execution of %preun scriptlet from fam-2.6.7-2mdk failed, exit
> > status 139
> > 
> 
> Anybody, please, commit this:
> 
> chkconfig-1.2.24-msec.patch:
> 
> ...
> +static int GetSecureLevel(void) 
> +{
> +char *ret;
> +struct stat buf;
> +
> +if (stat("/usr/sbin/msec", &stat) < 0) {
>   this must be `buf' not `stat'.
> 

Exact. Fixed in 9mdk. Sorry about that.
-- 
Fred - May the source be with you




RE: [Cooker] chkconfig segfaults

2002-01-31 Thread Borsenkow Andrej



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
Behalf
> Of Neuromancer
> Sent: Thursday, January 31, 2002 3:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Cooker] chkconfig segfaults
> 
> Thus spake Borsenkow Andrej about Life, the Universe, and Everything:
> | +if (stat("/usr/sbin/msec", &stat) < 0) {
> |   this must be `buf' not `stat'.
> 
> I hope you don't mind, but I was wondering if you could explain the
> difference
> to me.  Maybe I can learn something today.  ;)

buf is variable which address is (to be) taken. I do not know how
compiler interprets stat in this context. You can't take address of
structure type name to my best knowledge.

-andrej




RE: [Cooker] chkconfig segfaults

2002-01-31 Thread Borsenkow Andrej

> 
> fam
> ##
> /var/tmp/rpm-tmp.28048: line 1:  2788 Segmentation fault
> /sbin/chkconfig --add xinetd
> error: execution of %preun scriptlet from fam-2.6.7-2mdk failed, exit
> status 139
> 

Anybody, please, commit this:

chkconfig-1.2.24-msec.patch:

...
+static int GetSecureLevel(void) 
+{
+char *ret;
+struct stat buf;
+
+if (stat("/usr/sbin/msec", &stat) < 0) {
  this must be `buf' not `stat'.

-andrej