From a3edacb315cd615c4a3388b313a914de24a34f1a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 26 Apr 1995 16:12:01 +0000 Subject: [PATCH] (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) --- src/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sort.c b/src/sort.c index 3c0b3a5..d45b664 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; -- 2.7.4