mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Retire redundant tmp vars
This commit is contained in:
parent
1b035d6ffd
commit
5ae9993a12
12
nnn.c
12
nnn.c
|
@ -2186,8 +2186,7 @@ nochange:
|
||||||
printwarn();
|
printwarn();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
r = fstat(fd, &sb);
|
if (fstat(fd, &sb) == -1) {
|
||||||
if (r == -1) {
|
|
||||||
printwarn();
|
printwarn();
|
||||||
close(fd);
|
close(fd);
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
@ -2563,14 +2562,12 @@ nochange:
|
||||||
if (ndents > 0) {
|
if (ndents > 0) {
|
||||||
mkpath(path, dents[cur].name, oldpath, PATH_MAX);
|
mkpath(path, dents[cur].name, oldpath, PATH_MAX);
|
||||||
|
|
||||||
r = lstat(oldpath, &sb);
|
if (lstat(oldpath, &sb) == -1) {
|
||||||
if (r == -1) {
|
|
||||||
if (dents)
|
if (dents)
|
||||||
dentfree(dents);
|
dentfree(dents);
|
||||||
errexit();
|
errexit();
|
||||||
} else {
|
} else {
|
||||||
r = show_stats(oldpath, dents[cur].name, &sb);
|
if (show_stats(oldpath, dents[cur].name, &sb) < 0) {
|
||||||
if (r < 0) {
|
|
||||||
printwarn();
|
printwarn();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
@ -2743,8 +2740,7 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rename the file */
|
/* Rename the file */
|
||||||
r = renameat(fd, dents[cur].name, fd, tmp);
|
if (renameat(fd, dents[cur].name, fd, tmp) != 0) {
|
||||||
if (r != 0) {
|
|
||||||
printwarn();
|
printwarn();
|
||||||
close(fd);
|
close(fd);
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
|
Loading…
Reference in a new issue