btrfs-progs: print value when assertion fails

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-10-03 15:41:25 +02:00
parent db64e0a636
commit 9adce1abe4

View File

@ -85,11 +85,11 @@ static inline void assert_trace(const char *assertion, const char *filename,
if (val) if (val)
return; return;
if (assertion) if (assertion)
fprintf(stderr, "%s:%d: %s: Assertion `%s` failed.\n", fprintf(stderr, "%s:%d: %s: Assertion `%s` failed, value %d\n",
filename, line, func, assertion); filename, line, func, assertion, val);
else else
fprintf(stderr, "%s:%d: %s: Assertion failed.\n", filename, fprintf(stderr, "%s:%d: %s: Assertion failed, value %d.\n",
line, func); filename, line, func, val);
print_trace(); print_trace();
exit(1); exit(1);
} }