This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 64c29da2559a084d3ba74dcdaa03cbd0f4189dee (commit)
via 6c2fe0153226238cdf342e13333cec65a2b769d0 (commit)
from 9b68844bac11d8d0737c74986ca6add744acd223 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/64c29da2559a084d3ba74dcdaa03cbd0f4189dee
commit 64c29da2559a084d3ba74dcdaa03cbd0f4189dee
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 07:44:29 2010 +0200
proxy.c: declare functions and file-scoped variables static
diff --git a/proxy.c b/proxy.c
index bfdde25..bf4c165 100644
--- a/proxy.c
+++ b/proxy.c
@@ -97,13 +97,13 @@ typedef struct {
json_t *cur_server;
} query_ctx_t;
-repl_item *queue_head = NULL;
-repl_item *queue_tail = NULL;
-pthread_mutex_t queue_lock;
-sem_t queue_sema;
-json_t *config = NULL;
+static repl_item *queue_head = NULL;
+static repl_item *queue_tail = NULL;
+static pthread_mutex_t queue_lock;
+static sem_t queue_sema;
+static json_t *config = NULL;
-int
+static int
validate_server (unsigned int i)
{
json_t *server;
@@ -265,8 +265,8 @@ err:
return 0;
}
-size_t
-junk_writer (void *ptr, size_t size, size_t nmemb, void *stream)
+static size_t
+junk_writer (/* const */ void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t n;
@@ -280,7 +280,7 @@ junk_writer (void *ptr, size_t size, size_t nmemb, void *stream)
return n;
}
-void *
+static void *
proxy_repl_prod_fs (void *ctx)
{
repl_item *item = ctx;
@@ -336,7 +336,7 @@ proxy_repl_prod_fs (void *ctx)
return NULL;
}
-void *
+static void *
proxy_repl_prod (void *ctx)
{
repl_item *item = ctx;
@@ -400,7 +400,7 @@ done:
return NULL;
}
-size_t
+static size_t
junk_reader (void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t n;
@@ -410,14 +410,14 @@ junk_reader (void *ptr, size_t size, size_t nmemb, void *stream)
return n;
}
-size_t
+static size_t
cf_writer (void *ptr ATTRIBUTE_UNUSED, size_t size, size_t nmemb,
void *stream ATTRIBUTE_UNUSED)
{
return size * nmemb;
}
-size_t
+static size_t
cf_header (void *ptr, size_t size, size_t nmemb, void *stream)
{
char *next;
@@ -447,7 +447,7 @@ cf_header (void *ptr, size_t size, size_t nmemb, void *stream)
return size * nmemb;
}
-const char *
+static const char *
get_cloudfiles_token (json_t *server, const char *host, unsigned int port,
const char * user, const char * key)
{
@@ -498,7 +498,7 @@ get_cloudfiles_token (json_t *server, const char *host, unsigned int
port,
return token_obj ? json_string_value(token_obj) : NULL;
}
-void *
+static void *
proxy_repl_cons (void *ctx)
{
repl_item *item = ctx;
@@ -626,7 +626,7 @@ proxy_repl_cons (void *ctx)
return NULL;
}
-void
+static void
repl_worker_del (const repl_item *item)
{
json_t *server;
@@ -686,7 +686,7 @@ repl_worker_del (const repl_item *item)
DPRINTF("%s returningn",__func__);
}
-void
+static void
repl_worker_bcreate (repl_item *item)
{
json_t *server;
@@ -744,7 +744,7 @@ repl_worker_bcreate (repl_item *item)
DPRINTF("%s returningn",__func__);
}
-void *
+static void *
repl_worker (void *notused ATTRIBUTE_UNUSED)
{
repl_item *item;
@@ -805,7 +805,7 @@ repl_init (void)
pthread_create(&tid,NULL,repl_worker,NULL);
}
-char *
+static char *
repl_oget (void *ctx, const char *id)
{
query_ctx_t *qctx = ctx;
@@ -816,7 +816,7 @@ repl_oget (void *ctx, const char *id)
return cur_value;
}
-char *
+static char *
repl_sget (void *ctx, const char *id)
{
query_ctx_t *qctx = ctx;
@@ -912,7 +912,7 @@ replicate (const char *url, size_t size, const char *policy)
free(url2);
}
-void
+static void
replicate_namespace_action (const char *name, repl_t action)
{
unsigned int i;
http://repo.or.cz/w/iwhd.git/commit/6c2fe0153226238cdf342e13333cec65a2b769d0
commit 6c2fe0153226238cdf342e13333cec65a2b769d0
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Oct 1 16:01:20 2010 +0200
don't ignore write failures
* proxy.c (junk_writer): Don't ignore fwrite failure.
Warn upon fwrite or fflush failure.
* rest.c (main): Don't ignore fflush failure.
Exit upon fflush or preceding printf failure.
diff --git a/proxy.c b/proxy.c
index e89b3df..bfdde25 100644
--- a/proxy.c
+++ b/proxy.c
@@ -271,7 +271,10 @@ junk_writer (void *ptr, size_t size, size_t nmemb, void *stream)
size_t n;
n = fwrite(ptr,size,nmemb,stream);
- fflush(stream);
+ if (n != nmemb)
+ error(0, 0, "warning: write failed");
+ if (fflush(stream))
+ error(0, 0, "warning: write failed");
DPRINTF("in %s(%zu,%zu) => %zun",__func__,size,nmemb,n);
return n;
diff --git a/rest.c b/rest.c
index c808d1a..f501674 100644
--- a/rest.c
+++ b/rest.c
@@ -1793,7 +1793,8 @@ args_done:
printf("db is at %s:%un",db_host,db_port);
printf("will listen on port %un",my_port);
printf("my location is "%s"n",me);
- fflush(stdout);
+ if (fflush(stdout) || ferror(stdout))
+ error(EXIT_FAILURE, 0, "write failed");
}
backend_init();
-----------------------------------------------------------------------
Summary of changes:
proxy.c | 47 +++++++++++++++++++++++++----------------------
rest.c | 3 ++-
2 files changed, 27 insertions(+), 23 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")