[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30944 - Extractor/src/plugins
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30944 - Extractor/src/plugins |
Date: |
Thu, 28 Nov 2013 17:17:47 +0100 |
Author: grothoff
Date: 2013-11-28 17:17:47 +0100 (Thu, 28 Nov 2013)
New Revision: 30944
Modified:
Extractor/src/plugins/rpm_extractor.c
Log:
-whitespace, try to fix freebsd pthread issues
Modified: Extractor/src/plugins/rpm_extractor.c
===================================================================
--- Extractor/src/plugins/rpm_extractor.c 2013-11-28 16:06:32 UTC (rev
30943)
+++ Extractor/src/plugins/rpm_extractor.c 2013-11-28 16:17:47 UTC (rev
30944)
@@ -28,7 +28,11 @@
#include <rpm/rpmlib.h>
#include <rpm/rpmts.h>
#include <rpm/rpmlog.h>
+#if SOMEBSD
+#include <pthread_np.h>
+#else
#include <pthread.h>
+#endif
#include <sys/types.h>
#include <signal.h>
@@ -36,9 +40,9 @@
/**
* Closure for the 'pipe_feeder'.
*/
-struct PipeArgs
+struct PipeArgs
{
-
+
/**
* Context for reading data from.
*/
@@ -84,7 +88,7 @@
void *ptr;
char *buf;
- /* buffer is heap-allocated as this is a thread and
+ /* buffer is heap-allocated as this is a thread and
large stack allocations might not be the best idea */
while (0 == p->shutdown)
{
@@ -110,13 +114,13 @@
}
if (0 == wret)
break;
- done += wret;
+ done += wret;
}
if (done != rret)
break;
}
CLOSE (p->pi[1]);
- return NULL;
+ return NULL;
}
@@ -124,15 +128,15 @@
* LOG callback called by librpm. Does nothing, we
* just need this to override the default behavior.
*/
-static int
+static int
discard_log_callback (rpmlogRec rec,
- void *ctx)
+ void *ctx)
{
/* do nothing! */
return 0;
}
-
+
/**
* Mapping from RPM tags to LE types.
*/
@@ -152,7 +156,7 @@
/**
* List of mappings from RPM tags to LE types.
- */
+ */
static struct Matches tests[] = {
{RPMTAG_NAME, EXTRACTOR_METATYPE_PACKAGE_NAME},
{RPMTAG_VERSION, EXTRACTOR_METATYPE_SOFTWARE_VERSION},
@@ -238,7 +242,7 @@
/**
- * Main entry method for the 'application/x-rpm' extraction plugin.
+ * Main entry method for the 'application/x-rpm' extraction plugin.
*
* @param ec extraction context provided to the plugin
*/
@@ -298,7 +302,7 @@
goto END;
}
pthread_mutex_lock (&parg.lock);
- if (0 != ec->proc (ec->cls,
+ if (0 != ec->proc (ec->cls,
"rpm",
EXTRACTOR_METATYPE_MIMETYPE,
EXTRACTOR_METAFORMAT_UTF8,
@@ -322,18 +326,18 @@
case RPM_STRING_ARRAY_TYPE:
case RPM_I18NSTRING_TYPE:
case RPM_STRING_TYPE:
- while (NULL != (str = rpmtdNextString (p)))
+ while (NULL != (str = rpmtdNextString (p)))
{
pthread_mutex_lock (&parg.lock);
- if (0 != ec->proc (ec->cls,
+ if (0 != ec->proc (ec->cls,
"rpm",
tests[i].type,
EXTRACTOR_METAFORMAT_UTF8,
"text/plain",
str,
strlen (str) + 1))
-
- {
+
+ {
pthread_mutex_unlock (&parg.lock);
goto CLEANUP;
}
@@ -349,9 +353,9 @@
time_t tp = (time_t) *v;
ctime_r (&tp, tmp);
- tmp[strlen (tmp) - 1] = '\0'; /* eat linefeed */
+ tmp[strlen (tmp) - 1] = '\0'; /* eat linefeed */
pthread_mutex_lock (&parg.lock);
- if (0 != ec->proc (ec->cls,
+ if (0 != ec->proc (ec->cls,
"rpm",
tests[i].type,
EXTRACTOR_METAFORMAT_UTF8,
@@ -369,12 +373,12 @@
char tmp[14];
uint32_t *s = rpmtdNextUint32 (p);
- snprintf (tmp,
- sizeof (tmp),
- "%u",
+ snprintf (tmp,
+ sizeof (tmp),
+ "%u",
(unsigned int) *s);
pthread_mutex_lock (&parg.lock);
- if (0 != ec->proc (ec->cls,
+ if (0 != ec->proc (ec->cls,
"rpm",
tests[i].type,
EXTRACTOR_METAFORMAT_UTF8,
@@ -391,13 +395,13 @@
}
default:
break;
- }
+ }
}
CLEANUP:
rpmtdFree (p);
headerFreeIterator (hi);
- END:
+ END:
headerFree (hdr);
rpmtsFree(ts);
@@ -410,7 +414,7 @@
sigaction (SIGALRM, &sig, &old);
parg.shutdown = 1;
CLOSE (parg.pi[0]);
- Fclose (fdi);
+ Fclose (fdi);
pthread_kill (pthr, SIGALRM);
pthread_join (pthr, &unused);
pthread_mutex_destroy (&parg.lock);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30944 - Extractor/src/plugins,
gnunet <=