[MPlayer-dev-eng] [PATCH] x11_common: XChangeProperty uses long for 32-bits

Alexander Strasser eclipse7 at gmx.net
Wed Aug 17 19:35:17 CEST 2011


Hi Nicolas!

Nicolas George wrote:
> L'octidi 28 thermidor, an CCXIX, Alexander Strasser a écrit :
> >   I just remembered, what I didn't like about the patch. It only checks
> > the width of pid_t and aborts if it is not 32 bits. But I would rather
> > like to check the value, because a system might have a 64 bit pid_t type
> > but only use 32 bits of it.
> 
> The following may work for that:
> 
> pid_t pid = getpid();
> long prop = pid;
> if (prop == pid) {
>     XChangeProperty(...);
> }
> 
> Single Unix at least guarantees that pid_t is a signed integer.

  My initial patch adapted to your proposal is attached.

  Would be good if someone could test, and verify if it works
as intended. I will also try to test it myself, but I can't
say when I will come to it.

  Also if someone sees where this approach could be seriously
flawed, please speak up.

  Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-x11_common-pid_transfer_v4.diff
Type: text/x-diff
Size: 661 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110817/317fbc42/attachment-0001.bin>


More information about the MPlayer-dev-eng mailing list