Project

General

Profile

« Previous | Next » 

Revision 392dc4de

Added by Ken McDonell about 13 years ago

  • ID 392dc4deeeba11bee4024af9ea55de77eeced3c8

Cleanup pid_t usage

A lot of small changes across many source files to cleanup how we
handle pid_t data types and process ids hiding in integer variables.
Driven by compilation warnings on some platforms, but most of these
are latent problems that were just lurking and waiting to bite us in
the future.

Most critical changes is to enlist configure assistance to determine the
correct printf format specification for a value of type pid_t. This
requires splitting platform_dev.in into platform_header.h.in and
platform_trailer.in, and typical printf construct now looks like
printf("... pid=%" FMT_PID " more fmt", ..., pid, ...);

Changes involve making the printf changes above and explicit casting
when int -> pid_t or pid_t -> int conversions are being done ...

  • audit getpid() and fork() calls everywhere
  • __pmSendCreds() 2nd arg (from) is int, although often value is of type pid_t in the caller
  • ditto for the 2nd arg (from) of __pmSendError()
  • __pmProcessExists() 1st arg (pid) is of type pid_t
  • __pmProcessTerminate() 1st arg (pid) is of type pid_t
  • __pmProcessCreate() return value is of type pid_t
  • ll_pid element of pmLoglabel is of type pid_t
  • audit pmLoopRegisterChild - 1st arg (pid) is of type pid_t, return value is of type pid_t and 1st arg (pid) of callback is of type pid_t
  • ill_pid element of __pmLogLabel is of type __int32_t
  • pid element of pmRecordHost is of type pid_t
  • agentPid element of PMDA structures in pmcd is of type pid_t
  • __pmMakeAuthCookie() 2nd arg (clientId) is of type pid_t
  • __pmLogFindLocalPorts() 1st arg (pid) is of type int
  • pid element of __pmLogPort is of type int
  • process element of mmv_disk_header_t is of type __int32_t
  • from element of __pmPDUHdr is of type __int32_t
  • from element of __pmTracePDUHdr is of type __int32_t
  • added
  • modified
  • copied
  • renamed
  • deleted