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.
unlink(socket_name);
ret = create_local_socket(socket_name, &unix_addr,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH);
unlink(socket_name);
ret = create_local_socket(socket_name, &unix_addr,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH);
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s: %s\n", PARA_STRERROR(-ret), socket_name);
if (listen(ret , 5) < 0) {
PARA_EMERG_LOG("%s", "can not listen on socket\n");
exit(EXIT_FAILURE);
if (listen(ret , 5) < 0) {
PARA_EMERG_LOG("%s", "can not listen on socket\n");
exit(EXIT_FAILURE);
goto out;
}
if (t->ret != sizeof(buf)) {
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));