X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfc_misc.c;h=44e1117be6342ec710d8e6848824cd55b9d6f895;hb=cdd9119e29f2f865403303adb8b6004b863db968;hp=a39f4591831ddf988f8cbcb74ab323658c74b76a;hpb=13cc886eb2edfe7be4e65067be6df01e2f08436a;p=tfcrypt.git diff --git a/tfc_misc.c b/tfc_misc.c index a39f459..44e1117 100644 --- a/tfc_misc.c +++ b/tfc_misc.c @@ -116,6 +116,17 @@ char *tfc_format_time(tfc_useconds t) 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;