From: Jim Meyering Date: Wed, 26 Apr 1995 16:12:01 +0000 (+0000) Subject: (tempname): AND-off high bits of pid so that its decimal X-Git-Tag: textutils-1_12_1~227 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3edacb315cd615c4a3388b313a914de24a34f1a;p=thirdparty%2Fcoreutils.git (tempname): AND-off high bits of pid so that its decimal string representation is no longer than five digits. From Hans Verkuil (hans@wyst.hobby.nl) --- diff --git a/src/sort.c b/src/sort.c index 3c0b3a5da3..d45b664994 100644 --- a/src/sort.c +++ b/src/sort.c @@ -315,7 +315,7 @@ tempname () (len && temp_file_prefix[len - 1] != '/' ? "%s/sort%5.5d%5.5d" : "%ssort%5.5d%5.5d"), - temp_file_prefix, (int) getpid (), ++seq); + temp_file_prefix, (unsigned int) getpid () & 0xffff, ++seq); node->name = name; node->next = temphead.next; temphead.next = node;