[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11701 - in Extractor/src: main plugins
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11701 - in Extractor/src: main plugins |
Date: |
Sun, 13 Jun 2010 01:18:29 +0200 |
Author: grothoff
Date: 2010-06-13 01:18:29 +0200 (Sun, 13 Jun 2010)
New Revision: 11701
Modified:
Extractor/src/main/extractor.c
Extractor/src/plugins/png_extractor.c
Log:
handle strange error better
Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c 2010-06-12 22:57:40 UTC (rev 11700)
+++ Extractor/src/main/extractor.c 2010-06-12 23:18:29 UTC (rev 11701)
@@ -1398,14 +1398,15 @@
int p1[2];
int p2[2];
pid_t pid;
+ int status;
+ plugin->cpid = -1;
#ifndef WINDOWS
if (0 != pipe (p1))
#else
if (0 != _pipe (p1, 0, _O_BINARY))
#endif
{
- plugin->cpid = -1;
plugin->flags = EXTRACTOR_OPTION_DISABLED;
return;
}
@@ -1417,7 +1418,6 @@
{
close (p1[0]);
close (p1[1]);
- plugin->cpid = -1;
plugin->flags = EXTRACTOR_OPTION_DISABLED;
return;
}
@@ -1444,14 +1444,13 @@
close (p1[1]);
close (p2[0]);
close (p2[1]);
- plugin->cpid = -1;
plugin->flags = EXTRACTOR_OPTION_DISABLED;
return;
}
if (pid == 0)
{
- close (p1[1]);
- close (p2[0]);
+ close (p1[1]);
+ close (p2[0]);
process_requests (plugin, p1[0], p2[1]);
_exit (0);
}
@@ -1460,7 +1459,16 @@
close (p2[1]);
plugin->cpipe_in = fdopen (p1[1], "w");
if (plugin->cpipe_in == NULL)
- perror ("fdopen");
+ {
+ perror ("fdopen");
+ (void) kill (plugin->cpid, SIGKILL);
+ waitpid (plugin->cpid, &status, 0);
+ close (p1[0]);
+ close (p2[1]);
+ plugin->cpid = -1;
+ plugin->flags = EXTRACTOR_OPTION_DISABLED;
+ return;
+ }
plugin->cpipe_out = p2[0];
}
Modified: Extractor/src/plugins/png_extractor.c
===================================================================
--- Extractor/src/plugins/png_extractor.c 2010-06-12 22:57:40 UTC (rev
11700)
+++ Extractor/src/plugins/png_extractor.c 2010-06-12 23:18:29 UTC (rev
11701)
@@ -130,6 +130,7 @@
int i;
int compressed;
char *buf;
+ char *lan;
uLongf bufLen;
int ret;
int zret;
@@ -143,15 +144,21 @@
language = &data[pos];
ret = 0;
if (stnlen (language, length - pos) > 0)
- ADDF (EXTRACTOR_METATYPE_LANGUAGE,
- stndup (language, length - pos));
+ {
+ lan = stndup (language, length - pos);
+ ADDF (EXTRACTOR_METATYPE_LANGUAGE,
+ lan);
+ }
pos += stnlen (language, length - pos) + 1;
if (pos + 1 >= length)
return 0;
translated = &data[pos]; /* already in utf-8! */
if (stnlen (translated, length - pos) > 0)
- ADDF (EXTRACTOR_METATYPE_KEYWORDS,
- stndup (translated, length - pos));
+ {
+ lan = stndup (translated, length - pos);
+ ADDF (EXTRACTOR_METATYPE_KEYWORDS,
+ lan);
+ }
pos += stnlen (translated, length - pos) + 1;
if (pos >= length)
return 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11701 - in Extractor/src: main plugins,
gnunet <=