Skip to content

Commit 8828f92

Browse files
committed
some more debug info
1 parent 1ef00b5 commit 8828f92

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/libc/stdio/fopen.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ FILE *_fopenraw(const char *pathname, const char *mode, vfs_file_t *ftab) _COMPL
9090

9191
int fclose(FILE *f) _COMPLEXIO
9292
{
93+
#ifdef _DEBUG
94+
__builtin_printf("fclose(%x)\n", (unsigned)f);
95+
#endif
9396
return _closeraw(f);
9497
}
9598

include/libc/unix/posixio.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ _openraw(void *fil_ptr, const char *orig_name, int flags, mode_t mode)
126126
#ifdef _DEBUG
127127
{
128128
unsigned *ptr = (unsigned *)v->open;
129-
__builtin_printf("_openraw: calling %x : %x\n", ptr[0], ptr[1]);
129+
__builtin_printf("_openraw: calling %x (%x : %x)\n", (unsigned)ptr, ptr[0], ptr[1]);
130130
}
131131
#endif
132132
r = (*v->open)(fil, name, flags);
@@ -215,6 +215,9 @@ int _closeraw(void *f_ptr)
215215
if (!f->state) {
216216
return _seterror(EBADF);
217217
}
218+
#ifdef _DEBUG
219+
__builtin_printf("$$$ _closeraw(%x)\n", (unsigned)f_ptr);
220+
#endif
218221
if (f->flush) {
219222
(*f->flush)(f);
220223
}
@@ -272,6 +275,9 @@ int creat(const char *name, mode_t mode)
272275
int close(int fd)
273276
{
274277
vfs_file_t *f;
278+
#ifdef _DEBUG
279+
__builtin_printf("close(%d)\n", fd);
280+
#endif
275281
if ((unsigned)fd >= (unsigned)_MAX_FILES) {
276282
return _seterror(EBADF);
277283
}

0 commit comments

Comments
 (0)