sfm

simple file manager
git clone git://git.afify.dev/sfm
Log | Files | Refs | README | LICENSE

commit 10c2b45445d2bd60bb2b769ad9871c963eb86287
parent e8ae66847594cdb994d1cfdbf255344877382916
Author: afify <hassan@afify.dev>
Date:   Mon,  7 Dec 2020 11:13:22 +0300

[ref] remove listdir after commands

- filesystem event will listdir

Diffstat:
Msfm.c | 11++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/sfm.c b/sfm.c @@ -783,8 +783,6 @@ crnd(void) if (mkdir(path, ndir_perm) < 0) print_error(strerror(errno)); - else if (listdir(AddHi, NULL) < 0) - print_error(strerror(errno)); free(user_input); free(path); @@ -813,14 +811,11 @@ crnf(void) rf = open(path, O_CREAT | O_EXCL, nf_perm); - if (rf < 0) { + if (rf < 0) print_error(strerror(errno)); - } else { + else if (close(rf) < 0) print_error(strerror(errno)); - else if (listdir(AddHi, NULL) < 0) - print_error(strerror(errno)); - } free(user_input); free(path); @@ -836,8 +831,6 @@ delfd(void) case 0: if (BETWEEN(cpane->hdir - 1, 1, cpane->dirc)) /* last entry */ cpane->hdir--; -// if (listdir(AddHi, NULL) < 0) -// print_error(strerror(errno)); break; } }