From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs/gfs_grow main.c
Date: 25 Oct 2007 20:02:05 -0000 [thread overview]
Message-ID: <20071025200205.10195.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2007-10-25 20:02:04
Modified files:
gfs/gfs_grow : main.c
Log message:
Resolves: bz 337961: gfs_grow /mountpoint/ does not work
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_grow/main.c.diff?cvsroot=cluster&r1=1.7&r2=1.8
--- cluster/gfs/gfs_grow/main.c 2007/08/22 08:58:43 1.7
+++ cluster/gfs/gfs_grow/main.c 2007/10/25 20:02:03 1.8
@@ -729,33 +729,42 @@
*/
static int
-find_fs(char *name)
+find_fs(const char *name)
{
FILE *fp = fopen("/proc/mounts", "r");
char buffer[4096];
char fstype[80];
int fsdump, fspass;
+ char *realname;
+ realname = realpath(name, NULL);
+ if (!realname) {
+ perror(name);
+ return -1;
+ }
if (fp == NULL) {
perror("open: /proc/mounts");
exit(EXIT_FAILURE);
}
while ((fgets(buffer, 4095, fp)) != NULL) {
buffer[4095] = 0;
- if (strstr(buffer, name) == 0)
+ if (strstr(buffer, realname) == 0)
continue;
if (sscanf(buffer, "%s %s %s %s %d %d", device, fspath, fstype,
fsoptions, &fsdump, &fspass) != 6)
continue;
if (strcmp(fstype, "gfs") != 0)
continue;
- if ((strcmp(device, name) != 0) && (strcmp(fspath, name) != 0))
+ if ((strcmp(device, realname) != 0) &&
+ (strcmp(fspath, realname) != 0))
continue;
fclose(fp);
+ free(realname);
return 0;
}
fprintf(stderr, "GFS Filesystem %s not found\n", name);
fclose(fp);
+ free(realname);
return 1;
}
next reply other threads:[~2007-10-25 20:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-25 20:02 rpeterso [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-25 20:02 [Cluster-devel] cluster/gfs/gfs_grow main.c rpeterso
2007-01-17 22:58 rpeterso
2007-01-17 19:08 rpeterso
2007-01-17 19:06 rpeterso
2006-08-10 19:48 rpeterso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071025200205.10195.qmail@sourceware.org \
--to=rpeterso@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).