/* attempting to append to a dir a zero length path */
if (len && *str == '/' && name->len == 0) {
fprintf(stderr, "fsstress: append_pathname failure\n");
- chdir(homedir);
+ assert(chdir(homedir) == 0);
abort();
/* NOTREACHED */
}
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = attr_list_path(&newname, buffer, buffersize, flags, cursor);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = attr_remove_path(&newname, attrname, flags);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
if (chdir(buf) == 0) {
rval = attr_set_path(&newname, attrname, attrvalue, valuelength,
flags);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
if (stat64(".", &statbuf) == 0 && statbuf.st_ino == top_ino)
return;
- chdir(homedir);
+ assert(chdir(homedir) == 0);
fprintf(stderr, "fsstress: check_cwd failure\n");
abort();
/* NOTREACHED */
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = creat_path(&newname, mode);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
}
}
errout:
- chdir("..");
+ assert(chdir("..") == 0);
free(homedir);
if (cleanup) {
+ int ret;
+
sprintf(cmd, "rm -rf %s", buf);
- system(cmd);
+ ret = system(cmd);
+ if (ret != 0)
+ perror("cleaning up");
cleanup_flist();
}
}
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = lchown_path(&newname, owner, group);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
if (strcmp(buf1, buf2) == 0) {
if (chdir(buf1) == 0) {
rval = link_path(&newname1, &newname2);
- chdir("..");
+ assert(chdir("..") == 0);
}
} else {
if (strcmp(buf1, "..") == 0)
append_pathname(&newname2, name2->path);
if (chdir(buf1) == 0) {
rval = link_path(&newname1, &newname2);
- chdir("..");
+ assert(chdir("..") == 0);
}
} else {
free_pathname(&newname1);
append_pathname(&newname1, name1->path);
if (chdir(buf2) == 0) {
rval = link_path(&newname1, &newname2);
- chdir("..");
+ assert(chdir("..") == 0);
}
}
}
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = lstat64_path(&newname, sbuf);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = mkdir_path(&newname, mode);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = mknod_path(&newname, mode, dev);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = open_path(&newname, oflag);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = opendir_path(&newname);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = readlink_path(&newname, lbuf, lbufsiz);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
if (strcmp(buf1, buf2) == 0) {
if (chdir(buf1) == 0) {
rval = rename_path(&newname1, &newname2);
- chdir("..");
+ assert(chdir("..") == 0);
}
} else {
if (strcmp(buf1, "..") == 0)
append_pathname(&newname2, name2->path);
if (chdir(buf1) == 0) {
rval = rename_path(&newname1, &newname2);
- chdir("..");
+ assert(chdir("..") == 0);
}
} else {
free_pathname(&newname1);
append_pathname(&newname1, name1->path);
if (chdir(buf2) == 0) {
rval = rename_path(&newname1, &newname2);
- chdir("..");
+ assert(chdir("..") == 0);
}
}
}
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = rmdir_path(&newname);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = stat64_path(&newname, sbuf);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = symlink_path(name1, &newname);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = truncate64_path(&newname, length);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;
separate_pathname(name, buf, &newname);
if (chdir(buf) == 0) {
rval = unlink_path(&newname);
- chdir("..");
+ assert(chdir("..") == 0);
}
free_pathname(&newname);
return rval;