rename variables with names as a standard library function (Alon Bar-Lev)

master
szaka 2008-01-23 21:15:00 +00:00
parent ba4e6dbd9e
commit a8791404f5
3 changed files with 11 additions and 11 deletions

View File

@ -2415,9 +2415,9 @@ static void fuse_lib_getlk(fuse_req_t req, fuse_ino_t ino,
static void fuse_lib_setlk(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi, struct flock *lock,
int sleep)
int should_sleep)
{
int err = fuse_lock_common(req, ino, fi, lock, sleep ? F_SETLKW : F_SETLK);
int err = fuse_lock_common(req, ino, fi, lock, should_sleep ? F_SETLKW : F_SETLK);
if (!err) {
struct fuse *f = req_fuse(req);
struct lock l;

View File

@ -841,7 +841,7 @@ static void do_getlk(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
}
static void do_setlk_common(fuse_req_t req, fuse_ino_t nodeid,
const void *inarg, int sleep)
const void *inarg, int should_sleep)
{
struct fuse_lk_in *arg = (struct fuse_lk_in *) inarg;
struct fuse_file_info fi;
@ -853,7 +853,7 @@ static void do_setlk_common(fuse_req_t req, fuse_ino_t nodeid,
convert_fuse_file_lock(&arg->lk, &flock);
if (req->f->op.setlk)
req->f->op.setlk(req, nodeid, &fi, &flock, sleep);
req->f->op.setlk(req, nodeid, &fi, &flock, should_sleep);
else
fuse_reply_err(req, ENOSYS);
}

View File

@ -122,18 +122,18 @@ static int add_default_subtype(const char *progname, struct fuse_args *args)
{
int res;
char *subtype_opt;
const char *basename = strrchr(progname, '/');
if (basename == NULL)
basename = progname;
else if (basename[1] != '\0')
basename++;
const char *prog_basename = strrchr(progname, '/');
if (prog_basename == NULL)
prog_basename = progname;
else if (prog_basename[1] != '\0')
prog_basename++;
subtype_opt = (char *) malloc(strlen(basename) + 64);
subtype_opt = (char *) malloc(strlen(prog_basename) + 64);
if (subtype_opt == NULL) {
fprintf(stderr, "fuse: memory allocation failed\n");
return -1;
}
sprintf(subtype_opt, "-osubtype=%s", basename);
sprintf(subtype_opt, "-osubtype=%s", prog_basename);
res = fuse_opt_add_arg(args, subtype_opt);
free(subtype_opt);
return res;