projects
/
tfcrypt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-O pid: show/log process id of running tfcrypt.
[tfcrypt.git]
/
tfc_misc.c
diff --git
a/tfc_misc.c
b/tfc_misc.c
index a39f4591831ddf988f8cbcb74ab323658c74b76a..44e1117be6342ec710d8e6848824cd55b9d6f895 100644
(file)
--- a/
tfc_misc.c
+++ b/
tfc_misc.c
@@
-116,6
+116,17
@@
char *tfc_format_time(tfc_useconds t)
return r;
}
return r;
}
+char *tfc_format_pid(const char *str)
+{
+ static char r[128];
+ size_t n;
+
+ n = xstrlcpy(r, str, sizeof(r));
+ if (show_pid == YES && sizeof(r)-n >= 22) sprintf(r+n, "[%lu]", (unsigned long)progpid);
+
+ return r;
+}
+
tfc_fsize tfc_fdsize(int fd)
{
off_t l, cur;
tfc_fsize tfc_fdsize(int fd)
{
off_t l, cur;