#define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log */
#endif
-static char *progname;
+static char *xprogname;
static void
usage(void)
{
- fprintf(stderr, "usage: %s [-f] [-v] mnt-dir\n", progname);
+ fprintf(stderr, "usage: %s [-f] [-v] mnt-dir\n", xprogname);
}
int
char *mnt_dir;
int fd;
- progname = argv[0];
+ xprogname = argv[0];
while ((c = getopt(argc, argv, "fv")) != -1) {
switch (c) {
if ((stat(mnt_dir, &st)) == -1) {
fprintf(stderr, "%s: error on stat \"%s\": %s\n",
- progname, mnt_dir, strerror(errno));
+ xprogname, mnt_dir, strerror(errno));
return 1;
}
if (!S_ISDIR(st.st_mode)) {
fprintf(stderr, "%s: argument \"%s\" is not a directory\n",
- progname, mnt_dir);
+ xprogname, mnt_dir);
return 1;
}
struct statvfs stvfs;
if ((statvfs(mnt_dir, &stvfs)) == -1) {
fprintf(stderr, "%s: error on statfs \"%s\": %s\n",
- progname, mnt_dir, strerror(errno));
+ xprogname, mnt_dir, strerror(errno));
return 1;
}
if (strcmp(stvfs.f_basetype, "xfs") != 0) {
fprintf(stderr, "%s: filesys for \"%s\" is not XFS:\"%s\"\n",
- progname, mnt_dir, stvfs.f_basetype);
+ xprogname, mnt_dir, stvfs.f_basetype);
return 1;
}
}
}
if ((fd = open(mnt_dir, O_RDONLY)) == -1) {
fprintf(stderr, "%s: error on open of \"%s\": %s\n",
- progname, mnt_dir, strerror(errno));
+ xprogname, mnt_dir, strerror(errno));
return 1;
}
}
if ((xfsctl(mnt_dir, fd, XFS_IOC_GOINGDOWN, &flag)) == -1) {
fprintf(stderr, "%s: error on xfsctl(GOINGDOWN) of \"%s\": %s\n",
- progname, mnt_dir, strerror(errno));
+ xprogname, mnt_dir, strerror(errno));
return 1;
}
}
close(fd);
}
- if (!getuid) {
+ if (!getuid()) {
if (chmod(path, 0777) == -1) {
fprintf(stderr, "chmod(%s, 0777) failed: %s\n", path, strerror(errno));
fail++;
}
close(fd);
}
- if (!getuid) {
+ if (!getuid()) {
if (chmod(path, 0777) == -1) {
fprintf(stderr, "chmod(%s, 0777) failed: %s\n", path, strerror(errno));
fail++;