Changeset 579 for trunk/src/sh_mem.c
- Timestamp:
- May 14, 2023, 10:08:17 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_mem.c
r516 r579 77 77 #endif 78 78 79 /* define MEM_LOG to an absolute filename to enable this */ 79 /* define MEM_LOG to enable this */ 80 /* #define MEM_LOG 1 */ 80 81 #ifdef MEM_LOG 81 82 void sh_mem_dump () … … 83 84 memlist_t * this = memlist; 84 85 FILE * fd; 85 86 static unsigned int nr = 0; 87 char filename[256]; 88 89 snprintf(filename, sizeof(filename), "sh_mem_dump.%04u.%lu", nr, (unsigned long) sh.pid); 90 86 91 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 87 92 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 88 93 89 fd = fopen( MEM_LOG, "w");94 fd = fopen(filename, "w"); 90 95 if (!fd) 91 96 { 92 perror( MEM_LOG);97 perror(filename); 93 98 _exit(EXIT_FAILURE); 94 99 } … … 103 108 104 109 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 105 _exit(EXIT_SUCCESS); 110 ++nr; 111 /* _exit(EXIT_SUCCESS); */ 112 return; 106 113 } 107 114 #else
Note:
See TracChangeset
for help on using the changeset viewer.