In case of the "Path too long" message prints the stacktrace

This commit is contained in:
Andrea Mazzoleni 2015-12-12 16:56:57 +01:00
parent f8214de959
commit 7313e3d9d0
4 changed files with 9 additions and 5 deletions

View file

@ -90,11 +90,13 @@ noinst_HEADERS = \
mktest_SOURCES = \
cmdline/mktest.c \
cmdline/mingw.c \
cmdline/unix.c \
cmdline/support.c
mkstream_SOURCES = \
cmdline/mkstream.c \
cmdline/mingw.c \
cmdline/unix.c \
cmdline/support.c \
cmdline/util.c \
cmdline/stream.c \

View file

@ -255,6 +255,7 @@ void os_abort(void)
printf(", gcc " __VERSION__);
#endif
printf(", %d-bit", (int)sizeof(void *) * 8);
printf(", PATH_MAX=%d", PATH_MAX);
printf("\n");
/* get stackstrace, but without symbols */

View file

@ -356,7 +356,7 @@ void pathcpy(char* dst, size_t size, const char* src)
if (len + 1 > size) {
/* LCOV_EXCL_START */
log_fatal("Path too long\n");
exit(EXIT_FAILURE);
os_abort();
/* LCOV_EXCL_STOP */
}
@ -371,7 +371,7 @@ void pathcat(char* dst, size_t size, const char* src)
if (dst_len + src_len + 1 > size) {
/* LCOV_EXCL_START */
log_fatal("Path too long\n");
exit(EXIT_FAILURE);
os_abort();
/* LCOV_EXCL_STOP */
}
@ -385,7 +385,7 @@ void pathcatc(char* dst, size_t size, char c)
if (dst_len + 2 > size) {
/* LCOV_EXCL_START */
log_fatal("Path too long\n");
exit(EXIT_FAILURE);
os_abort();
/* LCOV_EXCL_STOP */
}
@ -433,7 +433,7 @@ void pathprint(char* dst, size_t size, const char* format, ...)
if (len >= size) {
/* LCOV_EXCL_START */
log_fatal("Path too long\n");
exit(EXIT_FAILURE);
os_abort();
/* LCOV_EXCL_STOP */
}
}
@ -446,7 +446,7 @@ void pathslash(char* dst, size_t size)
if (len + 2 >= size) {
/* LCOV_EXCL_START */
log_fatal("Path too long\n");
exit(EXIT_FAILURE);
os_abort();
/* LCOV_EXCL_STOP */
}

View file

@ -1103,6 +1103,7 @@ void os_abort(void)
printf(", gcc " __VERSION__);
#endif
printf(", %d-bit", (int)sizeof(void *) * 8);
printf(", PATH_MAX=%d", PATH_MAX);
printf("\n");
size = backtrace(stack, 32);