[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#7489: [coreutils] over aggressive threads in sort
From: |
Paul Eggert |
Subject: |
Re: bug#7489: [coreutils] over aggressive threads in sort |
Date: |
Sat, 27 Nov 2010 16:57:53 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 |
Could you please try this little patch? It should fix your
problem. I came up with this fix in my sleep (literally!
I woke up this morning and the patch was in my head), but
haven't had time to look at the code in this area to see
if it's the best fix.
Clearly there's at least one more bug as noted in my previous email
<http://lists.gnu.org/archive/html/bug-coreutils/2010-11/msg00216.html>
but I expect it's less likely to fire.
diff --git a/src/sort.c b/src/sort.c
index 7e25f6a..1aa1eb4 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -3226,13 +3226,13 @@ queue_pop (struct merge_node_queue *queue)
static void
write_unique (struct line const *line, FILE *tfp, char const *temp_output)
{
- static struct line const *saved = NULL;
+ static struct line saved;
if (!unique)
write_line (line, tfp, temp_output);
- else if (!saved || compare (line, saved))
+ else if (!saved.text || compare (line, &saved))
{
- saved = line;
+ saved = *line;
write_line (line, tfp, temp_output);
}
}
- [coreutils] over aggressive threads in sort, Pádraig Brady, 2010/11/22
- Re: [coreutils] over aggressive threads in sort, DJ Lucas, 2010/11/27
- Re: bug#7489: [coreutils] over aggressive threads in sort, Pádraig Brady, 2010/11/26
- Re: bug#7489: [coreutils] over aggressive threads in sort, Paul Eggert, 2010/11/27
- Re: bug#7489: [coreutils] over aggressive threads in sort, Paul Eggert, 2010/11/27
- Re: bug#7489: [coreutils] over aggressive threads in sort,
Paul Eggert <=
- Re: bug#7489: [coreutils] over aggressive threads in sort, Pádraig Brady, 2010/11/27
- Re: bug#7489: [coreutils] over aggressive threads in sort, DJ Lucas, 2010/11/27
- Re: bug#7489: [coreutils] over aggressive threads in sort, DJ Lucas, 2010/11/29
- Re: bug#7489: [coreutils] over aggressive threads in sort, Pádraig Brady, 2010/11/29
- Re: bug#7489: [coreutils] over aggressive threads in sort, Paul Eggert, 2010/11/29
- Re: bug#7489: [coreutils] over aggressive threads in sort, Jim Meyering, 2010/11/29
- Re: bug#7489: [coreutils] over aggressive threads in sort, Jim Meyering, 2010/11/30
- Re: bug#7489: [coreutils] over aggressive threads in sort, Paul Eggert, 2010/11/30
- Re: bug#7489: [coreutils] over aggressive threads in sort, Jim Meyering, 2010/11/29
- Re: bug#7489: [coreutils] over aggressive threads in sort, Paul Eggert, 2010/11/29