소스 검색

Use stat() instead of open() + fstat()

master
sin 10 년 전
부모
커밋
ef7082b691
1개의 변경된 파일1개의 추가작업 그리고 11개의 파일을 삭제
  1. +1
    -11
      noice.c

+ 1
- 11
noice.c 파일 보기

@@ -493,7 +493,6 @@ begin:
char *pathnew;
char *name;
char *bin;
int fd;
char *dir;
char *tmp;
regex_t re;
@@ -583,14 +582,7 @@ nochange:
DPRINTF_S(pathnew);

/* Get path info */
fd = open(pathnew, O_RDONLY | O_NONBLOCK);
if (fd == -1) {
printwarn();
free(pathnew);
goto nochange;
}
r = fstat(fd, &sb);
close(fd);
r = stat(pathnew, &sb);
if (r == -1) {
printwarn();
free(pathnew);
@@ -619,11 +611,9 @@ nochange:
free(pathnew);
goto nochange;
}

exitcurses();
spawn(bin, pathnew);
initcurses();

free(pathnew);
goto redraw;
}


불러오는 중...
취소
저장