From mboxrd@z Thu Jan 1 00:00:00 1970 From: teigland@sourceware.org Date: 28 Jun 2007 17:58:31 -0000 Subject: [Cluster-devel] cluster/gfs2/mount util.c Message-ID: <20070628175831.7310.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Changes by: teigland at sourceware.org 2007-06-28 17:58:31 Modified files: gfs2/mount : util.c Log message: - add more specific warnings/errors when connecting to gfs_controld fails - use strerror to report more helpful error messages in a few spots Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/util.c.diff?cvsroot=cluster&r1=1.24&r2=1.25 --- cluster/gfs2/mount/util.c 2007/06/06 15:45:11 1.24 +++ cluster/gfs2/mount/util.c 2007/06/28 17:58:31 1.25 @@ -327,8 +327,11 @@ int rv, fd; fd = socket(PF_UNIX, SOCK_STREAM, 0); - if (fd < 0) + if (fd < 0) { + warn("can't create socket for gfs_controld connection: %s", + strerror(errno)); goto out; + } memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_UNIX; @@ -337,6 +340,7 @@ rv = connect(fd, (struct sockaddr *) &sun, addrlen); if (rv < 0) { + warn("can't connect to gfs_controld: %s", strerror(errno)); close(fd); fd = rv; } @@ -406,10 +410,8 @@ i = 0; do { fd = gfs_controld_connect(); - if (fd <= 0) { - warn("waiting for gfs_controld to start"); + if (fd <= 0) sleep(1); - } } while (fd <= 0 && ++i < 10); /* FIXME: should we start the daemon here? */ @@ -447,7 +449,7 @@ rv = write(fd, buf, sizeof(buf)); if (rv < 0) { - warn("gfs_controld write error: %d", rv); + warn("gfs_controld write error: %s", strerror(errno)); goto out; } @@ -463,7 +465,8 @@ memset(buf, 0, sizeof(buf)); rv = read(fd, buf, sizeof(buf)); if (rv < 0) { - warn("error reading result from gfs_controld: %d", rv); + warn("error reading result from gfs_controld: %s", + strerror(errno)); goto out; } rv = atoi(buf); @@ -637,10 +640,8 @@ i = 0; do { fd = gfs_controld_connect(); - if (fd <= 0) { - warn("waiting for gfs_controld to start"); + if (fd <= 0) sleep(1); - } } while (fd <= 0 && ++i < 10); if (fd <= 0) { @@ -717,10 +718,8 @@ i = 0; do { fd = gfs_controld_connect(); - if (fd <= 0) { - warn("waiting for gfs_controld to start"); + if (fd <= 0) sleep(1); - } } while (fd <= 0 && ++i < 10); if (fd <= 0) {