瀏覽代碼

Change debug file name, close before exit

master
Arun Prakash Jana 5 年之前
父節點
當前提交
cdc7d81b60
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 1 個檔案被更改,包括 7 行新增6 行删除
  1. +7
    -6
      src/nnn.c

+ 7
- 6
src/nnn.c 查看文件

@@ -121,21 +121,22 @@ xprintf(int fd, const char *fmt, ...)
static int
enabledbg()
{
FILE *fp = fopen("/tmp/nnn_debug", "w");
FILE *fp = fopen("/tmp/nnndbg", "w");

if (!fp) {
fprintf(stderr, "debug: open failed! (1)\n");
perror("dbg(1)");

fp = fopen("./nnn_debug", "w");
fp = fopen("./nnndbg", "w");
if (!fp) {
fprintf(stderr, "debug: open failed! (2)\n");
perror("dbg(2)");
return -1;
}
}

DEBUG_FD = fileno(fp);
DEBUG_FD = dup(fileno(fp));
fclose(fp);
if (DEBUG_FD == -1) {
fprintf(stderr, "debug: open fd failed!\n");
perror("dbg(3)");
return -1;
}



Loading…
取消
儲存