From: Andre Noll Date: Wed, 12 Sep 2007 17:46:03 +0000 (+0200) Subject: afs.c: Add log message, cast sizeof(). X-Git-Tag: v0.3.0~425 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=3e21547a6a0984979c396e2ec688fa1d57b0410e afs.c: Add log message, cast sizeof(). In case the local socket could not be created, we really should tell the user that fact. The other change in this patch is casting sizeof() to unsigned long which shuts gcc up on both i386 and x86_64. --- diff --git a/afs.c b/afs.c index d89406f3..143103de 100644 --- a/afs.c +++ b/afs.c @@ -512,8 +512,10 @@ static int setup_command_socket_or_die(void) unlink(socket_name); ret = create_local_socket(socket_name, &unix_addr, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH); - if (ret < 0) + if (ret < 0) { + PARA_EMERG_LOG("%s: %s\n", PARA_STRERROR(-ret), socket_name); exit(EXIT_FAILURE); + } if (listen(ret , 5) < 0) { PARA_EMERG_LOG("%s", "can not listen on socket\n"); exit(EXIT_FAILURE); @@ -675,8 +677,8 @@ static void command_post_select(struct sched *s, struct task *t) goto out; } if (t->ret != sizeof(buf)) { - PARA_NOTICE_LOG("short read (%d bytes, expected %u)\n", - t->ret, sizeof(buf)); + PARA_NOTICE_LOG("short read (%d bytes, expected %lu)\n", + t->ret, (long unsigned) sizeof(buf)); t->ret = 1; goto out; }