summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-04-26 16:12:01 +0000
committerJim Meyering <jim@meyering.net>1995-04-26 16:12:01 +0000
commita3edacb315cd615c4a3388b313a914de24a34f1a (patch)
treeef9dea946b608a0091f4d1d7f27b2ec5fd185ee9 /src
parent062c5a1fd00aedadd8344373a3c0498149bba4a7 (diff)
downloadcoreutils-a3edacb315cd615c4a3388b313a914de24a34f1a.tar.xz
(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)
Diffstat (limited to 'src')
-rw-r--r--src/sort.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c
index 3c0b3a5da..d45b66499 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;