From 3e21547a6a0984979c396e2ec688fa1d57b0410e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 12 Sep 2007 19:46:03 +0200 Subject: [PATCH] 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. --- afs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.39.5