Why we need redhat_lsb_trigger.c in redhat-lsb package?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Do we really need a fineness c program to make symbol link? In redhat-lsb.spec, we can see:
gcc $RPM_OPT_FLAGS -Os -static -fno-stack-protector -o
redhat_lsb_trigger{.%{_target_cpu},.c} -DLSBSOVER='"%{lsbsover}"' \
  -DLDSO='"%{ldso}"' -DLSBLDSO='"/%{_lib}/%{lsbldso}"' -D_GNU_SOURCE
install -m 700 redhat_lsb_trigger.%{_target_cpu} \
  $RPM_BUILD_ROOT%{_sbindir}/redhat_lsb_trigger.%{_target_cpu}

%triggerpostun -- glibc
if [ -x /usr/sbin/redhat_lsb_trigger.%{_target_cpu} ]; then
  /usr/sbin/redhat_lsb_trigger.%{_target_cpu}
fi

And in redhat_lsb_trigger.c, the main function is as follows:

int main (int argc, char **argv)
{
/* redhat_lsb_trigger.c:428: warning: unused variable 'ret' */
/*  long ret; */
  INTERNAL_SYSCALL_DECL (err);
  char lsbsover[] = LSBSOVER;
  char *LSBVER, *p = lsbsover;
  while ((LSBVER = strtok (p, " \t")) != NULL)
    {
      char buf[sizeof LSBLDSO + 1 + strlen (LSBVER)];
      p = buf;
      p = mempcpy (p, LSBLDSO, sizeof LSBLDSO - 1);
      *p++ = '.';
      strcpy (p, LSBVER);
      if (is_ia64 ())
INTERNAL_SYSCALL (symlink, err, 2, "/emul/ia32-linux/lib/" LDSO, buf);
      else
        INTERNAL_SYSCALL (symlink, err, 2, LDSO, buf);
      p = NULL;
    }
  INTERNAL_SYSCALL (exit, err, 1, 0);
  return 110;
}

Why need we use a manually c program, not sln command? We can copy a copy of sln, so we can use it even when glibc is removed.

Why?

Thanks alot
xning
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux